diff --git a/packages/api/src/controllers/dispatch/Calls911Controller.ts b/packages/api/src/controllers/dispatch/Calls911Controller.ts index 63f809b85..08412f525 100644 --- a/packages/api/src/controllers/dispatch/Calls911Controller.ts +++ b/packages/api/src/controllers/dispatch/Calls911Controller.ts @@ -353,6 +353,22 @@ export class Calls911Controller { throw new BadRequest("unitOffDuty"); } + const status = await prisma.statusValue.findFirst({ + where: { shouldDo: "SET_ASSIGNED" }, + }); + + if (status) { + const t = type === "leo" ? "officer" : "emsFdDeputy"; + // @ts-expect-error ignore + await prisma[t].update({ + where: { id: unit.id }, + data: { statusId: status.id }, + }); + + this.socket.emitUpdateOfficerStatus(); + this.socket.emitUpdateDeputyStatus(); + } + const assignedUnit = await prisma.assignedUnit.create({ data: { call911Id: callId,