diff --git a/utils/client-schedule.ts b/utils/client-schedule.ts index bd02514..1a14345 100644 --- a/utils/client-schedule.ts +++ b/utils/client-schedule.ts @@ -484,6 +484,8 @@ export class ClientSchedule extends ClientEntity { private checkLocationRefsForDeletion(id: Id) { for (const event of this.events.values()) { + if (event.deleted) + continue; for (const slot of event.slots) { for (let i = 0; i < slot.locations.length; i++) { if (slot.locations[i].id === id) { @@ -583,6 +585,9 @@ export class ClientSchedule extends ClientEntity { private checkRoleRefsForDeletion(id: Id) { for (const shift of this.shifts.values()) { + if (shift.deleted) { + continue; + } if (shift.role.id === id) { throw new Error(`Cannot delete role, shift "${shift.name}" depends on it`); }