Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
fix(manager): fix the logical operations to delete consultations
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 12, 2022
1 parent ee59e92 commit 04bf118
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions database/managers/employee_schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ export default class extends BaseManager<
throw new DatabaseError("Developer may have forgot to register the models.")
}

console.log(JSON.stringify({ targetTimes }), "\n\n\n\n\n")

const futureConsultations = await Consultation.findAll({
"include": [
{
Expand All @@ -171,7 +169,6 @@ export default class extends BaseManager<
const hours = scheduledStartAt.getHours()
const minutes = scheduledStartAt.getMinutes()
for (const [ userID, targetDay, targetStartTime, targetEndTime ] of targetTimes) {
console.log(targetTimes, { day, hours, minutes }, "\n\n\n\n")
if (
consultantInfo?.userID === userID
&& targetDay === day
Expand All @@ -184,11 +181,11 @@ export default class extends BaseManager<
)
)
&& (
targetEndTime.hours > hours
hours < targetEndTime.hours
// eslint-disable-next-line no-extra-parens
|| (
targetEndTime.hours === hours
&& targetEndTime.minutes >= minutes
&& minutes <= targetEndTime.minutes
)
)
) {
Expand Down

0 comments on commit 04bf118

Please sign in to comment.