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:
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user