API Mobile Event

Add:
- api/mobile/event/[id]/check-participants : untuk cek keikut sertaan peserta

Fix:
- api/mobile/event/route : tambah get berdasarkan kategory
- mobile/event/[id]/participants/route: clear code

### No Issue
This commit is contained in:
2025-09-15 17:22:37 +08:00
parent c89ad88d2d
commit 836d12bf2e
3 changed files with 234 additions and 65 deletions

View File

@@ -1,14 +1,13 @@
import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
export { POST , GET};
export { GET, POST };
async function POST(request: Request, { params }: { params: { id: string } }) {
try {
const { id } = params;
const { userId } = await request.json();
const createJoin = await prisma.event_Peserta.create({
data: {
eventId: id,
@@ -49,6 +48,7 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
async function GET(request: Request, { params }: { params: { id: string } }) {
try {
const { id } = params;
const data = await prisma.event_Peserta.findMany({
where: {
eventId: id,
@@ -63,6 +63,7 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
username: true,
Profile: {
select: {
id: true,
name: true,
imageId: true,
},