Fix UI Admin Menu Pendidikam, Add Menu User & Role

This commit is contained in:
2025-09-02 18:08:53 +08:00
parent 7ae83788b4
commit fa9601e126
86 changed files with 5349 additions and 2649 deletions

View File

@@ -1,35 +0,0 @@
// /api/user/update.ts
import prisma from '@/lib/prisma';
import { Context } from 'elysia';
export default async function userUpdate(context: Context) {
const { id } = context.params as { id: string };
const body = await context.body as {
nama?: string;
email?: string;
password?: string;
roleId?: string;
isActive?: boolean;
};
try {
const updated = await prisma.user.update({
where: { id },
data: {
...body,
},
});
return {
success: true,
message: 'User berhasil diupdate',
data: updated,
};
} catch (error) {
console.error(error);
return {
success: false,
message: 'Gagal mengupdate user',
};
}
}