Fix event

Deskripsi:
- Fix konfirmasi
- Fix qr code
This commit is contained in:
2024-12-06 09:08:57 +08:00
parent 59584f2461
commit 057df80c31
16 changed files with 436 additions and 159 deletions

View File

@@ -11,5 +11,5 @@ export async function GET(req: Request) {
userId: userId as string,
});
return NextResponse.json({ res });
return NextResponse.json(res, { status: 200 });
}

View File

@@ -1,9 +0,0 @@
import { NextResponse } from "next/server";
export async function GET(params: Request) {
const { searchParams } = new URL(params.url);
const userId = searchParams.get("userId");
return NextResponse.json({ userId });
}

View File

@@ -0,0 +1,12 @@
import { event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
import { toNumber } from "lodash";
import { NextResponse } from "next/server";
export async function GET(params: Request) {
const { searchParams } = new URL(params.url);
const page = searchParams.get("page");
const data = await event_getListAllPublish({ page: toNumber(page) });
return NextResponse.json({ data });
}

View 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 }
);
}