diff --git a/src/controllers/branch-controller.ts b/src/controllers/branch-controller.ts index bb0ba51..f988da4 100644 --- a/src/controllers/branch-controller.ts +++ b/src/controllers/branch-controller.ts @@ -210,7 +210,10 @@ export class BranchController extends Controller { }); if (headOfficeId) { - await prisma.branch.update({ where: { id: headOfficeId }, data: { status: Status.ACTIVE } }); + await prisma.branch.updateMany({ + where: { id: headOfficeId, status: Status.CREATED }, + data: { status: Status.ACTIVE }, + }); } this.setStatus(HttpStatus.CREATED);