From 0f96be4b408736382ff72cce8ba03b11dde1bfb2 Mon Sep 17 00:00:00 2001 From: Dev-CasperTheGhost <53900565+Dev-CasperTheGhost@users.noreply.github.com> Date: Sat, 9 Apr 2022 11:04:10 +0200 Subject: [PATCH] :hammer: chore: fix failing ci --- .../controllers/leo/incidents/IncidentController.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/api/src/controllers/leo/incidents/IncidentController.ts b/packages/api/src/controllers/leo/incidents/IncidentController.ts index c9e77ab8f..65bda0dd2 100644 --- a/packages/api/src/controllers/leo/incidents/IncidentController.ts +++ b/packages/api/src/controllers/leo/incidents/IncidentController.ts @@ -13,8 +13,9 @@ import { Socket } from "services/SocketService"; import type { z } from "zod"; import { UsePermissions, Permissions } from "middlewares/UsePermissions"; import type { MiscCadSettings } from "@snailycad/types"; -import { assignedUnitsInclude, findUnit } from "controllers/dispatch/911-calls/Calls911Controller"; +import { assignedUnitsInclude } from "controllers/dispatch/911-calls/Calls911Controller"; import { officerOrDeputyToUnit } from "lib/leo/officerOrDeputyToUnit"; +import { findUnit } from "lib/leo/findUnit"; export const incidentInclude = { creator: { include: leoProperties }, @@ -217,13 +218,9 @@ export class IncidentController { ) { await Promise.all( (data.unitsInvolved ?? []).map(async (id: string) => { - const { unit, type } = await findUnit( - id, - { - NOT: { status: { shouldDo: ShouldDoType.SET_OFF_DUTY } }, - }, - true, - ); + const { unit, type } = await findUnit(id, { + NOT: { status: { shouldDo: ShouldDoType.SET_OFF_DUTY } }, + }); if (!unit) { throw new BadRequest("unitOffDuty");