upd: division

Deskripsi:
- pembatasan user role
- log user

No Issues
This commit is contained in:
amel
2024-09-06 16:48:38 +08:00
parent 73ba6381ff
commit 51b18cd177
5 changed files with 34 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import { prisma } from "@/module/_global";
import { funGetUserByCookies } from "@/module/auth";
import { createLogUser } from "@/module/user";
import _ from "lodash";
import { revalidatePath, revalidateTag } from "next/cache";
import { NextResponse } from "next/server";
@@ -140,6 +141,9 @@ export async function POST(request: Request) {
revalidatePath('/divisi', 'page')
revalidateTag('divisi')
// create log user
const log = await createLogUser({ act: 'CREATE', desc: 'User membuat data divisi', table: 'division', data: data.id })
return NextResponse.json({ success: true, message: "Berhasil menambahkan divisi", data, }, { status: 200 });
} catch (error) {
console.error(error);