Add name/email editing and days-based course access in admin user card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 12:01:01 +05:00
parent e691124058
commit 6b5bfc853e
4 changed files with 69 additions and 15 deletions
+3 -1
View File
@@ -43,12 +43,14 @@ export async function bulkGrantAccess(
export async function updateUserContact(
userId: string,
data: { phone: string; birthday: string }
data: { name: string; email: string; phone: string; birthday: string }
) {
await requireAdmin();
await prisma.user.update({
where: { id: userId },
data: {
name: data.name.trim() || undefined,
email: data.email.trim() || undefined,
phone: data.phone.trim() || null,
birthday: data.birthday ? new Date(data.birthday) : null,
},
+2
View File
@@ -64,6 +64,8 @@ export default async function UserPage({ params }: Props) {
<div style={{ borderTop: "2px solid var(--border)", paddingTop: "1rem" }}>
<UserContactEditor
userId={userId}
name={user.name ?? ""}
email={user.email}
phone={user.phone ?? null}
birthday={user.birthday ?? null}
/>