Skip to content

Commit

Permalink
fix: find function rec sess
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed Mar 12, 2024
1 parent c9bb974 commit f0c6a4e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/src/recruitment-session/recruitment-session.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export class RecruitmentSessionService {
return await this.recruitmentSessionRepository.find();
}

async findRecruitmentSessionById(id: number): Promise<RecruitmentSession> {
return await this.recruitmentSessionRepository.findOne({ where: { id } });
async findRecruitmentSessionById(id: number): Promise<RecruitmentSession[]> {
return await this.recruitmentSessionRepository.findBy({ id });
}

// Modifit here if you want to assume to have more than a Recruitment Session
// active at the same time. Tests assume there is only one now.
async findActiveRecruitmentSession(): Promise<RecruitmentSession> {
return await this.recruitmentSessionRepository.findOne({
where: { state: RecruitmentSessionState.Active },
async findActiveRecruitmentSession(): Promise<RecruitmentSession[]> {
return await this.recruitmentSessionRepository.findBy({
state: RecruitmentSessionState.Active,
});
}

Expand Down

0 comments on commit f0c6a4e

Please sign in to comment.