From e44f563e35acbcc3cdd38f4f60a06a7fe8fa8331 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 5 Sep 2024 16:14:11 +0700 Subject: [PATCH] fix: wrong condition check --- src/controllers/03-customer-branch-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index 0f4830d..6bc535c 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -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.",