feat(api, ui): add Prisma client import and type definition for custom links
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { db } from "@/lib/db";
|
||||
|
||||
@@ -66,7 +67,7 @@ export async function PATCH(request: NextRequest) {
|
||||
username,
|
||||
avatar: avatar || null,
|
||||
bio: bio || null,
|
||||
customLinks: customLinks && customLinks.length > 0 ? customLinks : null,
|
||||
customLinks: customLinks && customLinks.length > 0 ? customLinks : Prisma.DbNull,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -5,6 +5,7 @@ import { db } from "@/lib/db";
|
||||
import config from "@/../prompts.config";
|
||||
import { ProfileForm } from "@/components/settings/profile-form";
|
||||
import { ApiKeySettings } from "@/components/settings/api-key-settings";
|
||||
import type { CustomLink } from "@/components/user/profile-links";
|
||||
|
||||
export default async function SettingsPage() {
|
||||
const session = await auth();
|
||||
@@ -44,7 +45,13 @@ export default async function SettingsPage() {
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
<ProfileForm user={user} showVerifiedSection={!config.homepage?.useCloneBranding} />
|
||||
<ProfileForm
|
||||
user={{
|
||||
...user,
|
||||
customLinks: user.customLinks as CustomLink[] | null,
|
||||
}}
|
||||
showVerifiedSection={!config.homepage?.useCloneBranding}
|
||||
/>
|
||||
|
||||
{config.features.mcp !== false && (
|
||||
<ApiKeySettings
|
||||
|
||||
Reference in New Issue
Block a user