Fix event
Deskripsi: - Fix konfirmasi - Fix qr code
This commit is contained in:
21
src/app/api/event/get-one-by-id/route.ts
Normal file
21
src/app/api/event/get-one-by-id/route.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(params: Request) {
|
||||
const { searchParams } = new URL(params.url);
|
||||
const eventId = searchParams.get("eventId");
|
||||
|
||||
const res = await event_getOneById(eventId as string);
|
||||
|
||||
if (!res) {
|
||||
return NextResponse.json(
|
||||
{ message: "Event Not Found", data: null },
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
|
||||
return NextResponse.json(
|
||||
{ message: "Event Found", data: res },
|
||||
{ status: 200 }
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user