From e82f3f37b2a6858a3891af877c66c0c667ef7af6 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:42:42 +0700 Subject: [PATCH] feat: also update customer status to active --- src/controllers/employee-controller.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/controllers/employee-controller.ts b/src/controllers/employee-controller.ts index e13c628..8fad526 100644 --- a/src/controllers/employee-controller.ts +++ b/src/controllers/employee-controller.ts @@ -392,6 +392,16 @@ export class EmployeeController extends Controller { data: { status: Status.ACTIVE }, }); + await prisma.customer.updateMany({ + where: { + branch: { + some: { id: customerBranchId }, + }, + status: Status.CREATED, + }, + data: { status: Status.ACTIVE }, + }); + this.setStatus(HttpStatus.CREATED); return Object.assign(record, {