From 97ee81561b27bf2534348fbd72654b8321f2ab12 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sun, 7 Sep 2025 15:35:29 +0300 Subject: [PATCH] fix(BaseService): streamline customer permission checks by consolidating conditions --- packages/graphql/api/base.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/graphql/api/base.ts b/packages/graphql/api/base.ts index fced362..fd65008 100644 --- a/packages/graphql/api/base.ts +++ b/packages/graphql/api/base.ts @@ -53,11 +53,7 @@ export class BaseService { const customer = result.data.customers.at(0); - if (!customer) { - throw new Error(BASE_ERRORS.NOT_FOUND_CUSTOMER); - } - - if (isCustomerBanned(customer)) { + if (customer && isCustomerBanned(customer)) { throw new Error(ERRORS.NO_PERMISSION); }