## Deskripsi :
- Prisma seeder
### No Issue
This commit is contained in:
2024-07-25 10:15:21 +08:00
parent 6bdacd137e
commit f336e8ad30
11 changed files with 185 additions and 62 deletions

View File

@@ -14,11 +14,22 @@ export async function Event_funCreate(req: MODEL_EVENT) {
tanggal: req.tanggal,
authorId: req.authorId,
},
select: {
id: true,
title: true,
EventMaster_Status: {
select: {
name: true,
}
},
authorId: true,
}
});
if (!res) return { status: 400, message: "Gagal Disimpan" };
revalidatePath("/dev/event/main/status_page");
return {
data: res,
status: 201,
message: "Berhasil Disimpan",
};

View File

@@ -4,13 +4,16 @@ import prisma from "@/app/lib/prisma";
import { revalidatePath } from "next/cache";
/**
*
*
* @param statusid | Review: 2, Draft: 3, Reject: 4
* @param eventId
* @param eventId
* @type string
* @returns Update status id dari setiap event
*/
export async function Event_funEditStatusById(statusid: string, eventId: string) {
export async function Event_funEditStatusById(
statusid: string,
eventId: string
) {
const updt = await prisma.event.update({
where: {
id: eventId,
@@ -18,11 +21,22 @@ export async function Event_funEditStatusById(statusid: string, eventId: string)
data: {
eventMaster_StatusId: statusid,
},
select: {
id: true,
title: true,
authorId: true,
EventMaster_Status: {
select: {
name: true,
},
},
},
});
if (!updt) return { status: 400, message: "Gagal Update Status" };
revalidatePath("/dev/event/main/status_page");
return {
data: updt,
status: 200,
message: "Berhasil Update Status",
};