Skip to content

Commit

Permalink
fix: set vehicle null when off-duty
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Jan 28, 2024
1 parent 4a9047a commit 6ee2bb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/api/src/controllers/dispatch/status-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class StatusController {
userDefinedCallsign = data.userDefinedCallsign;
}

let activeEmergencyVehicleId: string | undefined;
let activeEmergencyVehicleId: string | undefined | null;
if (data.vehicleId && code?.shouldDo === ShouldDoType.SET_ON_DUTY) {
const divisionIds = getDivisionsFromUnit(unit, isDivisionsEnabled);

Expand All @@ -152,6 +152,8 @@ export class StatusController {
}

activeEmergencyVehicleId = _emergencyVehicle.id;
} else if (code?.shouldDo === ShouldDoType.SET_OFF_DUTY) {
activeEmergencyVehicleId = null;
}

/**
Expand Down

0 comments on commit 6ee2bb5

Please sign in to comment.