From 27747643bce56c955c18a59a0349efabe6c28273 Mon Sep 17 00:00:00 2001 From: Juan Carlos Sigler Priego Date: Fri, 20 Sep 2024 00:02:12 -0400 Subject: [PATCH] Campos mentores a exportar --- src/lib/gcloud.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/gcloud.ts b/src/lib/gcloud.ts index 47ddac1..e55b6f5 100644 --- a/src/lib/gcloud.ts +++ b/src/lib/gcloud.ts @@ -260,6 +260,9 @@ export async function exportParticipants({ const json = participants .filter((v) => v.userParticipation.role === role) .map((participation) => { + const optInToString = (f: boolean): string => { + return f ? "Sí" : "No"; + }; let data: Record = { "Nombre completo": `${participation.user.firstName.trim()} ${participation.user.lastName.trim()}`, Email: participation.user.email.trim(), @@ -273,6 +276,20 @@ export async function exportParticipants({ Estado: userParticipation.schoolState, Escuela: userParticipation.schoolName.trim(), }; + } else if (userParticipation.role === "VOLUNTEER") { + data = { + ...data, + "Comunidad / Redes": optInToString( + userParticipation.communityOptIn, + ), + "Vinculación educativa": optInToString( + userParticipation.educationalLinkageOptIn, + ), + Fundraising: optInToString(userParticipation.fundraisingOptIn), + Entrenamientos: optInToString(userParticipation.trainerOptIn), + Problemsetter: optInToString(userParticipation.problemSetterOptIn), + Mentorías: optInToString(userParticipation.mentorOptIn), + }; } return data; });