From 0635ef062d872d95e338de7ccc222e154b2a20aa Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:09:37 +0700 Subject: [PATCH] feat: also delete branch that not sent on update --- src/controllers/customer-controller.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/customer-controller.ts b/src/controllers/customer-controller.ts index 086a8d2..24d930f 100644 --- a/src/controllers/customer-controller.ts +++ b/src/controllers/customer-controller.ts @@ -254,6 +254,9 @@ export class CustomerController extends Controller { data: { ...payload, branch: { + deleteMany: { + id: { notIn: customerBranch?.map((v) => v.id) || [] }, + }, updateMany: customerBranch?.map((v) => ({ where: { id: v.id },