This commit is contained in:
2026-02-09 15:59:46 +03:30
parent 8c9e7053f5
commit b6d94964f9
4 changed files with 18 additions and 18 deletions
@@ -1,4 +1,4 @@
import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common';
import { Injectable, BadRequestException } from '@nestjs/common';
import { EntityManager } from '@mikro-orm/postgresql';
import { Product } from 'src/modules/products/entities/product.entity';
import { UserAddress } from 'src/modules/users/entities/user-address.entity';
@@ -85,11 +85,6 @@ export class CartValidationService {
}
}
/**
* Get delivery method for shop or throw if not found
*/
/**
* Get enabled delivery method or throw if not found or disabled
*/
@@ -126,7 +121,7 @@ export class CartValidationService {
async getEnabledPaymentMethodOrFail(shopId: string, paymentMethodId: string): Promise<PaymentMethod> {
const paymentMethod = await this.paymentMethodService.findOneOrFail(paymentMethodId)
if (paymentMethod.shop.id !== shopId) {
throw new BadRequestException('CartMessage.PAYMENT_METHOD_NOT_BELONGS_TO_SHOP');
throw new BadRequestException(CartMessage.PAYMENT_METHOD_NOT_BELONGS_TO_SHOP);
}
if (!paymentMethod.enabled) {
throw new BadRequestException(CartMessage.PAYMENT_METHOD_NOT_ENABLED);