fix ( event )

deskripsi:
- create event sponsor
- penambahan database eventSponsor & eventTransaksi
- API create sponsor on progress
This commit is contained in:
2025-01-22 05:18:02 +07:00
parent 6bc2d3f628
commit 4ec5e9d387
11 changed files with 363 additions and 36 deletions

View File

@@ -48,3 +48,5 @@ export async function GET(
);
}
}

View File

@@ -0,0 +1,52 @@
import { prisma } from "@/app/lib";
import { NextResponse } from "next/server";
export async function POST(
request: Request,
context: { params: { id: string } }
) {
const method = request.method;
if (method !== "POST") {
return NextResponse.json(
{ success: false, message: "Method not allowed" },
{ status: 405 }
);
}
const { id } = context.params;
const body = await request.json();
console.log("body", body);
console.log("id", id);
// const res = await prisma.eventSponsor.create({
// })
return NextResponse.json({
success: true,
message: "Success create sponsor",
});
// try {
// const { id } = context.params;
// const body = await request.json();
// console.log("body",body);
// console.log("id",id);
// // const res = await prisma.eventSponsor.create({
// // })
// return NextResponse.json({
// success: true,
// message: "Success create sponsor",
// });
// } catch (error) {
// return NextResponse.json(
// { success: false, message: "Failed create sponsor" },
// { status: 500 }
// );
// }
}

View File

@@ -21,6 +21,10 @@ const DIRECTORY_ID = {
// Job
job_image: "cm0ypp6zl0003kp7jf59zuvjy",
// Event
event_sponsor: "cm65zlbyf001udvmggnd6i0oh",
event_bukti_transfer: "cm65zlehy001wdvmgnobur2zh",
};
export default DIRECTORY_ID;

View File

@@ -7,7 +7,7 @@ export const RouterEvent = {
riwayat: ({ id }: { id: string }) => `/dev/event/main/riwayat/${id}`,
/**
*
*
* @param statusId | 1 - 4 | 1: Publish, 2: Review, 3: Draft, 4: Reject
* @type string
*/
@@ -34,18 +34,13 @@ export const RouterEvent = {
detail_riwayat: "/dev/event/detail/riwayat/",
//peserta
daftar_peserta: ({ id }: { id: string }) =>
`/dev/event/detail/peserta/${id}`,
daftar_peserta: ({ id }: { id: string }) => `/dev/event/detail/peserta/${id}`,
//sponsor
daftar_sponsor: ({ id }: { id: string }) =>
`/dev/event/detail/sponsor/${id}`,
daftar_sponsor: ({ id }: { id: string }) => `/dev/event/detail/sponsor/${id}`,
edit_sponsor: "/dev/event/detail/sponsor/edit_sponsor/",
tambah_sponsor: "/dev/event/detail/sponsor/tambah_sponsor/",
tambah_sponsor: ({ id }: { id: string }) =>
`/dev/event/detail/sponsor/tambah_sponsor/${id}`,
detail_sponsor: ({ id }: { id: string }) =>
`/dev/event/detail/detail_sponsor/${id}`,
};