Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed Mar 12, 2024
1 parent 79d7705 commit 0b644b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/recruitment-session/recruitment-session.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ export class RecruitmentSessionController {
): Promise<RecruitmentSessionResponseDto> {
const recruitmentSession =
await this.recruitmentSessionService.findActiveRecruitmentSession()[0];
if (recruitmentSession === null) {
if (recruitmentSession.length === 0) {
throw new NotFoundException();
}

if (
!checkAbility(
ability,
Action.Read,
recruitmentSession,
recruitmentSession[0],
'RecruitmentSession',
)
) {
Expand Down Expand Up @@ -95,7 +95,7 @@ export class RecruitmentSessionController {
// there should be only one active recruitment session at a time
const hasActiveRecruitmentSession =
await this.recruitmentSessionService.findActiveRecruitmentSession();
if (hasActiveRecruitmentSession)
if (hasActiveRecruitmentSession.length)
throw new ConflictException(
'There is already an active recruitment session',
);
Expand Down

0 comments on commit 0b644b1

Please sign in to comment.