refactor(modules): update existing module implementations across attendance, audit, auth, classes, course-plans, exams, files, homework, layout, proctoring, questions, scheduling, textbooks, users

- Update attendance components and data-access for record management

- Update audit log views, filters, and data-access

- Update auth login and register forms

- Update classes actions, components, and data-access (admin, schedule, stats)

- Update course-plans actions, form, list, progress, and schema

- Update exams actions, AI pipeline, preview components, and hooks

- Update files components (icon, list, preview, upload) and data-access

- Update homework assignment form, review view, auto-save hook, and stats-service

- Update layout sidebar, header, and navigation config

- Update proctoring actions, anti-cheat monitor, and data-access

- Update questions actions, components (dialog, actions, columns, filters), and data-access

- Update scheduling actions, auto-scheduler, components, and schema

- Update textbooks constants and text-selection hook

- Update users class-registration, import-dialog, data-access, and user-service
This commit is contained in:
SpecialX
2026-06-23 17:38:56 +08:00
parent 1a9377222c
commit 4f0ef217a0
56 changed files with 1251 additions and 850 deletions

View File

@@ -92,6 +92,22 @@ export async function updateUserProfileById(
return await getUserProfile(userId)
}
/**
* Update a user's avatar image URL.
* Returns the updated user profile or null if the user was not found.
*/
export async function updateUserAvatar(
userId: string,
imageUrl: string | null
): Promise<UserProfile | null> {
await db
.update(users)
.set({ image: imageUrl })
.where(eq(users.id, userId))
return await getUserProfile(userId)
}
export type UsersDashboardStats = {
userCount: number
activeSessionsCount: number