Skip to content

Commit 309bb3e

Browse files
authored
Merge pull request #643 from xxcxy/fix-issues-591
fix issue 591
2 parents c0799d6 + 66168ce commit 309bb3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/services/InterviewService.js

+6
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,12 @@ async function getZoomLink (interviewId, data) {
907907
throw new errors.BadRequestError('Invalid type or id.')
908908
}
909909
const interview = await Interview.findById(interviewId)
910+
911+
// check if the interview zoom link is not expired
912+
const { Completed, Cancelled, Expired } = InterviewConstants.Status
913+
if (_.includes([Completed, Cancelled, Expired], interview.status)) {
914+
throw new errors.BadRequestError(`Zoom link is no longer available for this interview because the current status of the interview is "${interview.status}".`)
915+
}
910916
const zoomMeeting = await getZoomMeeting(interview.zoomAccountApiKey, interview.zoomMeetingId)
911917
if (data.type === ZoomLinkType.HOST) {
912918
return zoomMeeting.start_url

0 commit comments

Comments
 (0)