# Developer

## feat
- Memberi akses pada user menjadi admin
### No issue
This commit is contained in:
2024-04-04 14:32:48 +08:00
parent cdcdf704ff
commit f58a5afff5
12 changed files with 389 additions and 79 deletions

View File

@@ -0,0 +1,23 @@
"use server";
import prisma from "@/app/lib/prisma";
import { RouterAdminDeveloper } from "@/app/lib/router_admin/router_admin_developer";
import { revalidatePath } from "next/cache";
export default async function adminDeveloper_funEditUserAksesById(
userId: string,
roleId: string
) {
const updt = await prisma.user.update({
where: {
id: userId,
},
data: {
masterUserRoleId: roleId,
},
});
if (!updt) return { status: 400, message: "Gagal Update Akses" };
revalidatePath(RouterAdminDeveloper.main);
return { status: 200, message: "Berhasil Update Akses" };
}