From 5f724b4778c3ee4469f26b1f3ef857f5e085f786 Mon Sep 17 00:00:00 2001 From: AmirAgassi Date: Wed, 15 May 2024 21:25:37 -0400 Subject: [PATCH] Add allergies to admin ticket page --- functions/src/index.ts | 4 ++++ src/pages/admin/ViewTicket.page.tsx | 14 +++++++++++++- src/services/utils/types.ts | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/functions/src/index.ts b/functions/src/index.ts index 088fa456..26763aae 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -417,6 +417,7 @@ async function internalGetTicketData(id: string, extended = false) { let linkedin = ""; let github = ""; let resumeRef = ""; + let allergies: string[] = []; if (!app) { // grab from user record @@ -438,6 +439,7 @@ async function internalGetTicketData(id: string, extended = false) { app.participatingAs === "Mentor" ? app.mentorResumeRef : app.generalResumeRef; + allergies = app.allergies ?? []; } // get social ticket @@ -467,6 +469,7 @@ async function internalGetTicketData(id: string, extended = false) { pronouns, foods: [] as string[], events: [] as string[], + allergies, ...socials, }; @@ -478,6 +481,7 @@ async function internalGetTicketData(id: string, extended = false) { return data; } + export const getTicketData = functions.https.onCall(async (data) => { if (!z.string().uuid().safeParse(data.id).success) { return response(HttpStatus.BAD_REQUEST, { message: "bad request" }); diff --git a/src/pages/admin/ViewTicket.page.tsx b/src/pages/admin/ViewTicket.page.tsx index 83373069..1b99799e 100644 --- a/src/pages/admin/ViewTicket.page.tsx +++ b/src/pages/admin/ViewTicket.page.tsx @@ -134,6 +134,18 @@ export const AdminViewTicketPage = () => {

{ticketData.pronouns}

+
+

Allergies

+ {ticketData.allergies.length > 0 ? ( + + ) : ( +

No known allergies

+ )} +

Events