Files
hipmi/src/app/api/mobile/admin/event/[id]/participants/route.ts
bagasbanuna 3c2a8b3543 Fix QC Admin ( Inno )
- app.config.js
- app/(application)/(user)/forum/[id]/edit.tsx
- app/(application)/(user)/forum/[id]/index.tsx
- app/(application)/(user)/forum/create.tsx
- ios/HIPMIBadungConnect/Info.plist

### No Issue
2025-12-05 17:12:15 +08:00

59 lines
1.2 KiB
TypeScript

import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
export { GET };
async function GET(request: Request, { params }: { params: { id: string } }) {
try {
const { id } = params;
const data = await prisma.event_Peserta.findMany({
where: {
eventId: id,
},
select: {
eventId: true,
userId: true,
isPresent: true,
User: {
select: {
id: true,
username: true,
nomor: true,
Profile: {
select: {
id: true,
name: true,
imageId: true,
},
},
},
},
Event: {
select: {
tanggal: true,
},
},
},
});
return NextResponse.json(
{
success: true,
message: "Success get participants",
data: data,
},
{ status: 200 }
);
} catch (error) {
return NextResponse.json(
{
success: false,
message: "Error get participants",
reason: (error as Error).message,
},
{ status: 500 }
);
}
}