fix(BaseService): streamline customer permission checks by consolidating conditions

This commit is contained in:
vchikalkin 2025-09-07 15:35:29 +03:00
parent 16889db3b4
commit 97ee81561b

View File

@ -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);
}