Skip to content

Commit

Permalink
fix: minor3
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed Mar 12, 2024
1 parent 7b462e0 commit e19956e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/src/recruitment-session/recruitment-session.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class RecruitmentSessionController {
@ApiBadRequestResponse()
@ApiForbiddenResponse()
@ApiConflictResponse({
description: 'The recruitment session cannot be created', //
description: 'The recruitment session cannot be created',
})
@ApiCreatedResponse()
@JoiValidate({
Expand Down Expand Up @@ -125,13 +125,13 @@ export class RecruitmentSessionController {
const recruitmentSession =
await this.recruitmentSessionService.findRecruitmentSessionById(
sessionId,
)[0];
);

if (recruitmentSession === null) throw new NotFoundException();
if (recruitmentSession.length === 0) throw new NotFoundException();

const sessionToCheck = {
...updateRecruitmentSession,
sessionId: recruitmentSession.id,
sessionId: recruitmentSession[0].id,
};
if (
!checkAbility(
Expand All @@ -150,7 +150,7 @@ export class RecruitmentSessionController {
await this.recruitmentSessionService.findActiveRecruitmentSession()[0];
if (
currentlyActiveRecruitmentSession &&
currentlyActiveRecruitmentSession.id !== recruitmentSession.id // It's ok to set 'Active' to the (already) active recruitment session
currentlyActiveRecruitmentSession.id !== recruitmentSession[0].id // It's ok to set 'Active' to the (already) active recruitment session
)
throw new ConflictException(
'There is already an active recruitment session',
Expand All @@ -161,7 +161,7 @@ export class RecruitmentSessionController {
// Recruitment session can't be set to concluded if it has pending interviews
const hasPendingInterviews =
await this.recruitmentSessionService.sessionHasPendingInterviews(
recruitmentSession,
recruitmentSession[0],
);
if (hasPendingInterviews)
throw new ConflictException(
Expand All @@ -172,7 +172,7 @@ export class RecruitmentSessionController {

const updatedRecruitmentSession =
await this.recruitmentSessionService.updateRecruitmentSession({
...recruitmentSession,
...recruitmentSession[0],
...updateRecruitmentSession,
lastModified: new Date(),
});
Expand Down

0 comments on commit e19956e

Please sign in to comment.