Skip to content

Commit

Permalink
fix: changed fetching of interview room in email/sms
Browse files Browse the repository at this point in the history
Co-Authored-By: @sindremil
  • Loading branch information
jorgengaldal committed Sep 14, 2024
1 parent b508633 commit 5528459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
19 changes: 1 addition & 18 deletions lib/sendInterviewTimes/sendInterviewTimes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,13 @@ const formatApplicants = async (
interview.committeeName.toLowerCase()
);

const committeeTime = committeeInterviewTimes.find(
(time) =>
time.committee.toLowerCase() === interview.committeeName.toLowerCase()
);

let room = "Info kommer";

if (committeeTime) {
const availableTime = committeeTime.availabletimes.find(
(available) =>
available.start <= interview.start && available.end >= interview.end
);
if (availableTime) {
room = availableTime.room;
}
}

return {
committeeName: interview.committeeName,
committeeEmail: committeeEmail?.email || "",
interviewTime: {
start: interview.start,
end: interview.end,
room: room,
room: interview.room,
},
};
});
Expand Down
1 change: 1 addition & 0 deletions lib/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export type algorithmType = {
start: string;
end: string;
committeeName: string;
room: string;
}[];
};

Expand Down

0 comments on commit 5528459

Please sign in to comment.