From ef8530d3cb19b63f72e9ed0f0d04f32a576c723c Mon Sep 17 00:00:00 2001 From: Ishaan Upadhyay <33141569+ishaan-upadhyay@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:01:55 -0400 Subject: [PATCH] [CIT-43] Bugfix, add user attending status (#42) --- citrus/app/api/experiences/route.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/citrus/app/api/experiences/route.ts b/citrus/app/api/experiences/route.ts index 3e267df..95521cb 100644 --- a/citrus/app/api/experiences/route.ts +++ b/citrus/app/api/experiences/route.ts @@ -253,9 +253,19 @@ export async function POST(request: Request) { set: body.tags }, org_id: body.org_id, - user_id: body.user_id + user_id: body.user_id, + attendees: body.attendees } }); + for (var i = 0; i < body.attendees.length; i++) { + var attending_status = await prisma.user_attending_status.create({ + data: { + username: body.attendees[i], + event_id: event.id, + attending: "interested" + } + }); + } return NextResponse.json(event); } catch (e) { return db.handleError(e);