Fix event

Deskripsi:
- Fix user server menjadi API di beranda
This commit is contained in:
2024-12-06 13:51:39 +08:00
parent 72cd56deb8
commit 2b08326bed
22 changed files with 476 additions and 235 deletions

View File

@@ -0,0 +1,15 @@
import { event_funCheckPesertaByUserId } from "@/app_modules/event/fun";
import { NextResponse } from "next/server";
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
const userId = searchParams.get("userId");
const eventId = searchParams.get("eventId");
const res = await event_funCheckPesertaByUserId({
eventId: eventId as string,
userId: userId as string,
});
return NextResponse.json(res, { status: 200 });
}

View File

@@ -0,0 +1,16 @@
import { event_newGetListPesertaById } from "@/app_modules/event/fun";
import { toNumber } from "lodash";
import { NextResponse } from "next/server";
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
const eventId = searchParams.get("eventId");
const page = searchParams.get("page");
const res = await event_newGetListPesertaById({
eventId: eventId as string,
page: toNumber(page),
});
return NextResponse.json(res, { status: 200 });
}