Add comment field to user profile in admin panel

- Prisma: User.comment String? column + migration
- UserContactEditor: comment shown in view mode, textarea in edit mode
- updateUserContact action: saves comment to DB
This commit is contained in:
2026-05-06 14:06:53 +00:00
parent 4f3b389f05
commit 48721759d3
5 changed files with 68 additions and 29 deletions
+2 -1
View File
@@ -43,7 +43,7 @@ export async function bulkGrantAccess(
export async function updateUserContact(
userId: string,
data: { name: string; email: string; phone: string; birthday: string }
data: { name: string; email: string; phone: string; birthday: string; comment: string }
) {
await requireAdmin();
await prisma.user.update({
@@ -53,6 +53,7 @@ export async function updateUserContact(
email: data.email.trim() || undefined,
phone: data.phone.trim() || null,
birthday: data.birthday ? new Date(data.birthday) : null,
comment: data.comment.trim() || null,
},
});
revalidatePath(`/admin/users/${userId}`);
+1
View File
@@ -68,6 +68,7 @@ export default async function UserPage({ params }: Props) {
email={user.email}
phone={user.phone ?? null}
birthday={user.birthday ?? null}
comment={user.comment ?? null}
/>
</div>
</section>