fix bugs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user