refactor: do not update status if not created
This commit is contained in:
parent
1412938e27
commit
97cc610171
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue