fix: wrong condition check

This commit is contained in:
Methapon Metanipat 2024-09-05 16:14:11 +07:00
parent 1c04e475b6
commit e44f563e35

View file

@ -391,7 +391,7 @@ export class CustomerBranchController extends Controller {
);
}
} else {
if (!affilationBranch || !affilationHeadBranch) {
if (!affilationBranch && !affilationHeadBranch) {
throw new HttpError(
HttpStatus.FORBIDDEN,
"You do not have permission to perform this action.",
@ -544,7 +544,7 @@ export class CustomerBranchController extends Controller {
);
}
} else {
if (!affilationBranch || !affilationHeadBranch) {
if (!affilationBranch && !affilationHeadBranch) {
throw new HttpError(
HttpStatus.FORBIDDEN,
"You do not have permission to perform this action.",