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 8ceb10da9..27037741d 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 @@ -43,7 +43,7 @@ export class PLEventGuestsService { data.memberUid = isAdmin ? data.memberUid : member.uid; const guests = this.formatInputToEventGuests(data); const result = await (tx || this.prisma).pLEventGuest.createMany({ data: guests }); - await this.cacheService.reset(); + this.cacheService.reset(); return result; } catch(err) { this.handleErrors(err); @@ -151,8 +151,8 @@ export class PLEventGuestsService { description: true, startDate: true, endDate: true, - logo: true, - banner: true, + logo: { select: { url: true } }, + banner: { select: { url: true } }, resources: true, additionalInfo: true } @@ -160,7 +160,7 @@ export class PLEventGuestsService { member: { select: { name: true, - image: true, + image: { select: { url: true } }, telegramHandler: isUserLoggedIn ? true : false, preferences: true, officeHours: isUserLoggedIn ? true : false, @@ -170,7 +170,7 @@ export class PLEventGuestsService { select:{ uid: true, name: true, - logo: true + logo: { select: { url: true } } } } } @@ -197,7 +197,7 @@ export class PLEventGuestsService { select:{ uid: true, name: true, - logo: true + logo: { select: { url: true } } } }, createdAt: true, @@ -206,7 +206,7 @@ export class PLEventGuestsService { } }); this.restrictTelegramBasedOnMemberPreference(result, isUserLoggedIn); - this.restrictOfficeHours(result, isUserLoggedIn); + // this.restrictOfficeHours(result, isUserLoggedIn); return result; } catch(err) { @@ -287,10 +287,10 @@ export class PLEventGuestsService { restrictTelegramBasedOnMemberPreference(eventGuests, isUserLoggedIn: boolean) { if (isUserLoggedIn && eventGuests) { eventGuests = eventGuests.map((guest:any) => { - if (!guest.telegramId) { - delete guest.member.telegramHandler; - return guest; - } + // if (!guest.telegramId) { + // delete guest.member.telegramHandler; + // return guest; + // } if (!guest.member.preferences) { return guest; } diff --git a/apps/web-api/src/pl-events/pl-events.service.ts b/apps/web-api/src/pl-events/pl-events.service.ts index dbaaf3952..6d50e11c1 100644 --- a/apps/web-api/src/pl-events/pl-events.service.ts +++ b/apps/web-api/src/pl-events/pl-events.service.ts @@ -49,8 +49,8 @@ export class PLEventsService { const plEvent = await this.prisma.pLEvent.findUniqueOrThrow({ where: { slugURL: slug }, include: { - logo: true, - banner: true, + logo: { select: { url: true } }, + banner: { select: { url: true } }, eventGuests: { select: { uid: true, @@ -66,12 +66,12 @@ export class PLEventsService { officeHours: isUserLoggedIn ? true : false, event: { include: { - logo: true + logo: { select: { url: true } } } }, member: { select:{ - image: true, + image: { select: { url: true } }, name: true, preferences: true, telegramHandler: isUserLoggedIn ? true : false, @@ -82,7 +82,7 @@ export class PLEventsService { select:{ uid: true, name: true, - logo: true + logo: { select: { url: true } } } } } @@ -109,7 +109,7 @@ export class PLEventsService { select:{ uid: true, name: true, - logo: true + logo: { select: { url: true } } } } } @@ -119,7 +119,7 @@ export class PLEventsService { if (plEvent) { this.filterPrivateResources(plEvent, isUserLoggedIn); plEvent.eventGuests = this.eventGuestsService.restrictTelegramBasedOnMemberPreference(plEvent?.eventGuests, isUserLoggedIn); - plEvent.eventGuests = this.eventGuestsService.restrictOfficeHours(plEvent?.eventGuests, isUserLoggedIn); + // plEvent.eventGuests = this.eventGuestsService.restrictOfficeHours(plEvent?.eventGuests, isUserLoggedIn); } return plEvent; } catch(err) {