From 0596a937a813225f24fc64c093de457529149eea Mon Sep 17 00:00:00 2001 From: white Date: Sun, 19 May 2024 22:28:37 +0200 Subject: [PATCH] debug: test 6 --- api/src/timeslots/timeslots.service.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/api/src/timeslots/timeslots.service.ts b/api/src/timeslots/timeslots.service.ts index 3ade8fb..f623b9c 100644 --- a/api/src/timeslots/timeslots.service.ts +++ b/api/src/timeslots/timeslots.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { Repository, LessThan, MoreThan, QueryRunner } from 'typeorm'; +import { Repository, LessThan, MoreThan, QueryRunner, Not, In } from 'typeorm'; import { TimeSlot } from './timeslot.entity'; import { RecruitmentSession, @@ -185,6 +185,21 @@ export class TimeSlotsService { ); const allMatches = await queryBuilder.getMany(); + return this.timeSlotRepository.find({ + relations: [ + 'availabilities', + 'availabilities.user', + 'recruitmentSession', + ], + where: { + availabilities: { + state: AvailabilityState.Free, + user: { + role: Not(In([Role.Applicant, Role.None])), + }, + }, + }, + }); return allMatches; let goodTimeSlots: TimeSlot[] = [];