fix: condition not cover
This commit is contained in:
parent
a065df3b1f
commit
bcd765c71a
1 changed files with 8 additions and 0 deletions
|
|
@ -330,6 +330,14 @@ export class BranchController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
if (last.value !== 1 && !headOfficeId) {
|
||||
throw new HttpError(
|
||||
HttpStatus.BAD_REQUEST,
|
||||
"Branch with same code already exists.",
|
||||
"sameBranchCodeExists",
|
||||
);
|
||||
}
|
||||
|
||||
return await tx.branch.create({
|
||||
include: {
|
||||
province: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue