From 7603a2d82a9098cbe328dd7bccd02543643dde67 Mon Sep 17 00:00:00 2001 From: casperiv0 <53900565+casperiv0@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:12:59 +0200 Subject: [PATCH] fix(business-transfer): disconnect citizen from vehicle (closes #1944) --- apps/api/src/controllers/citizen/vehicles-controller.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/api/src/controllers/citizen/vehicles-controller.ts b/apps/api/src/controllers/citizen/vehicles-controller.ts index 3d3f96471..ebcf6476d 100644 --- a/apps/api/src/controllers/citizen/vehicles-controller.ts +++ b/apps/api/src/controllers/citizen/vehicles-controller.ts @@ -497,6 +497,7 @@ export class VehiclesController { const updatedVehicle = await prisma.registeredVehicle.update({ where: { id: vehicle.id }, data: { + citizen: vehicle.citizenId ? { disconnect: { id: vehicle.citizenId } } : undefined, Business: { connect: { id: data.businessId } }, }, });