# fix
## Deskripsi : - Prisma seeder ### No Issue
This commit is contained in:
@@ -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",
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user