Fix event
Deskripsi: - Fix konfirmasi - Fix qr code
This commit is contained in:
@@ -11,5 +11,5 @@ export async function GET(req: Request) {
|
||||
userId: userId as string,
|
||||
});
|
||||
|
||||
return NextResponse.json({ res });
|
||||
return NextResponse.json(res, { status: 200 });
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
12
src/app/api/event/get-all/route.ts
Normal file
12
src/app/api/event/get-all/route.ts
Normal 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 });
|
||||
}
|
||||
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