From 9a18cbde98cccd98a1411dc050ccef48118c80f3 Mon Sep 17 00:00:00 2001 From: Navaneethakrishnan Date: Fri, 15 Nov 2024 12:44:11 +0530 Subject: [PATCH 1/2] feat: added all events and releated guest API changes --- .../web-api/src/pl-events/pl-event-guests.service.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/web-api/src/pl-events/pl-event-guests.service.ts b/apps/web-api/src/pl-events/pl-event-guests.service.ts index bf7c091e0..50dcfb2a8 100644 --- a/apps/web-api/src/pl-events/pl-event-guests.service.ts +++ b/apps/web-api/src/pl-events/pl-event-guests.service.ts @@ -125,8 +125,10 @@ export class PLEventGuestsService { const { type, filteredEvents } = query; if (type === "upcoming") { events = await this.eventLocationsService.getUpcomingEventsByLocation(locationUid); - } else { + } else if (type === "past") { events = await this.eventLocationsService.getPastEventsByLocation(locationUid); + } else { + events = (await this.eventLocationsService.getPLEventLocationByUid(locationUid)).events; } events = await this.filterEventsByAttendanceAndAdminStatus(filteredEvents, events, member); if (events.length === 0) @@ -657,8 +659,10 @@ export class PLEventGuestsService { let events; if (type === "upcoming") { events = await this.eventLocationsService.getUpcomingEventsByLocation(locationUid); - } else { + } else if (type === "past") { events = await this.eventLocationsService.getPastEventsByLocation(locationUid); + } else { + events = (await this.eventLocationsService.getPLEventLocationByUid(locationUid)).events; } let uniqueTopics = await this.prisma.pLEventGuest.findMany({ where: { @@ -714,8 +718,10 @@ export class PLEventGuestsService { let events; if (type === "upcoming") { events = await this.eventLocationsService.getUpcomingEventsByLocation(locationUid); - } else { + } else if (type === "past") { events = await this.eventLocationsService.getPastEventsByLocation(locationUid); + } else { + events = (await this.eventLocationsService.getPLEventLocationByUid(locationUid)).events; } const result = await this.prisma.pLEventGuest.findMany({ where: { From f3cb1b72a92eb4d01f865e49e1685a1c15fa9438 Mon Sep 17 00:00:00 2001 From: Navaneethakrishnan Date: Fri, 15 Nov 2024 18:42:08 +0530 Subject: [PATCH 2/2] fix: fixed issue in irl fetch guests by location api --- apps/web-api/src/pl-events/pl-event-guests.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web-api/src/pl-events/pl-event-guests.service.ts b/apps/web-api/src/pl-events/pl-event-guests.service.ts index 50dcfb2a8..8ea507220 100644 --- a/apps/web-api/src/pl-events/pl-event-guests.service.ts +++ b/apps/web-api/src/pl-events/pl-event-guests.service.ts @@ -183,7 +183,7 @@ export class PLEventGuestsService { query: Prisma.PLEventGuestFindManyArgs ) { try { - const events = await this.eventLocationsService.getUpcomingEventsByLocation(locationUid); + const events = (await this.eventLocationsService.getPLEventLocationByUid(locationUid)).events; return await this.prisma.pLEventGuest.findMany({ where: { eventUid: {