From 79e9593663a46bd95879bc90af50abf6ff06e0c7 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:13:06 -0600 Subject: [PATCH] feat(profile): add optional name field to user profile form and schema --- .../settings/profile/profile-form.tsx | 18 ++++++++++++++++++ packages/server/src/db/schema/user.ts | 1 + 2 files changed, 19 insertions(+) diff --git a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx index 59e4736de..49fdfd2dd 100644 --- a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx +++ b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx @@ -36,6 +36,7 @@ const profileSchema = z.object({ password: z.string().nullable(), currentPassword: z.string().nullable(), image: z.string().optional(), + name: z.string().optional(), allowImpersonation: z.boolean().optional().default(false), }); @@ -84,6 +85,7 @@ export const ProfileForm = () => { image: data?.user?.image || "", currentPassword: "", allowImpersonation: data?.user?.allowImpersonation || false, + name: data?.user?.name || "", }, resolver: zodResolver(profileSchema), }); @@ -97,6 +99,7 @@ export const ProfileForm = () => { image: data?.user?.image || "", currentPassword: form.getValues("currentPassword") || "", allowImpersonation: data?.user?.allowImpersonation, + name: data?.user?.name || "", }, { keepValues: true, @@ -119,6 +122,7 @@ export const ProfileForm = () => { image: values.image, currentPassword: values.currentPassword || undefined, allowImpersonation: values.allowImpersonation, + name: values.name || undefined, }) .then(async () => { await refetch(); @@ -128,6 +132,7 @@ export const ProfileForm = () => { password: "", image: values.image, currentPassword: "", + name: values.name || "", }); }) .catch(() => { @@ -167,6 +172,19 @@ export const ProfileForm = () => { className="grid gap-4" >