fix(BaseService): streamline customer permission checks by consolidating conditions
This commit is contained in:
parent
16889db3b4
commit
97ee81561b
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user