fix: can not update profile image, close #2267

This commit is contained in:
Stephen Zhou 2024-12-25 09:45:24 +08:00
parent 14784466dd
commit d42f52d3f1
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ import { CopyButton } from "~/components/ui/code-highlighter"
import { toastFetchError } from "~/lib/error-parser"
const formSchema = z.object({
handle: z.string().max(50),
handle: z.string().max(50).optional(),
name: z.string().min(3).max(50),
image: z.string().url(),
})
@ -43,7 +43,7 @@ export const ProfileSettingForm = ({
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
handle: user?.handle || "",
handle: user?.handle || undefined,
name: user?.name || "",
image: user?.image || "",
},