From a4a43adccbc7ec8a4f815bd6f6744790819072d9 Mon Sep 17 00:00:00 2001 From: white Date: Sun, 19 May 2024 22:49:30 +0200 Subject: [PATCH] debug: test 9 --- api/src/timeslots/timeslots.e2e-spec.ts | 22 ---------------------- api/src/timeslots/timeslots.service.ts | 3 ++- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/api/src/timeslots/timeslots.e2e-spec.ts b/api/src/timeslots/timeslots.e2e-spec.ts index b175296..a618636 100644 --- a/api/src/timeslots/timeslots.e2e-spec.ts +++ b/api/src/timeslots/timeslots.e2e-spec.ts @@ -910,28 +910,6 @@ describe('TimeslotsController', () => { expect(allAvailabilities).toHaveLength(mockAvailability.length); }); - it('DEBUG: check format of an Availabilities table in db', async () => { - const availability = await availabilityService.findById(1); - expect(availability).toBeDefined(); - expect(availability).toHaveProperty('id', 1); - expect(availability).toHaveProperty('state'); - expect(availability).toHaveProperty('lastModified'); - expect(availability).toHaveProperty('timeSlot'); - expect(availability).toHaveProperty('user'); - expect(availability).toEqual(mockAvailability[0]); - }); - - it('DEBUG: check format of a TimeSlots table in db', async () => { - const timeSlot = await timeSlotsService.findById(51); - expect(timeSlot).toBeDefined(); - expect(timeSlot).toHaveProperty('id', 51); - expect(timeSlot).toHaveProperty('start'); - expect(timeSlot).toHaveProperty('end'); - expect(timeSlot).toHaveProperty('recruitmentSession'); - expect(timeSlot).toHaveProperty('availabilities'); - expect(timeSlot).toEqual(mockTimeSlots[0]); - }); - it('DEBUG: check availabilities for timeslot having id 71 & 73', async () => { const allAvailabilities = await availabilityService.listAvailabilities(); const av71 = allAvailabilities.filter((a) => a.timeSlot.id === 71); diff --git a/api/src/timeslots/timeslots.service.ts b/api/src/timeslots/timeslots.service.ts index 852ebd3..7272b64 100644 --- a/api/src/timeslots/timeslots.service.ts +++ b/api/src/timeslots/timeslots.service.ts @@ -186,7 +186,7 @@ export class TimeSlotsService { ); queryBuilder.getMany(); - const allMatches = await this.timeSlotRepository.find({ + return await this.timeSlotRepository.find({ relations: [ 'availabilities', 'availabilities.user', @@ -201,6 +201,7 @@ export class TimeSlotsService { }, }, }); + let allMatches = await queryBuilder.getMany(); let goodTimeSlots: TimeSlot[] = []; allMatches.forEach((timeSlot) => {