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:
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user