website refactor

This commit is contained in:
2026-01-14 02:02:24 +01:00
parent 8d7c709e0c
commit 4522d41aef
291 changed files with 12763 additions and 9309 deletions

View File

@@ -15,31 +15,29 @@ import { revalidatePath } from 'next/cache';
/**
* Update user status
*/
export async function updateUserStatus(userId: string, status: string): Promise<void> {
try {
const mutation = new UpdateUserStatusMutation();
await mutation.execute({ userId, status });
// Revalidate the users page
revalidatePath('/admin/users');
} catch (error) {
console.error('updateUserStatus failed:', error);
export async function updateUserStatus(userId: string, status: string) {
const mutation = new UpdateUserStatusMutation();
const result = await mutation.execute({ userId, status });
if (result.isErr()) {
console.error('updateUserStatus failed:', result.getError());
throw new Error('Failed to update user status');
}
revalidatePath('/admin/users');
}
/**
* Delete user
*/
export async function deleteUser(userId: string): Promise<void> {
try {
const mutation = new DeleteUserMutation();
await mutation.execute({ userId });
// Revalidate the users page
revalidatePath('/admin/users');
} catch (error) {
console.error('deleteUser failed:', error);
export async function deleteUser(userId: string) {
const mutation = new DeleteUserMutation();
const result = await mutation.execute({ userId });
if (result.isErr()) {
console.error('deleteUser failed:', result.getError());
throw new Error('Failed to delete user');
}
revalidatePath('/admin/users');
}