payment method
This commit is contained in:
@@ -67,9 +67,9 @@ export class RestaurantPaymentMethodService {
|
||||
);
|
||||
}
|
||||
|
||||
async findByPaymentMethod(paymentMethodId: string): Promise<RestaurantPaymentMethod[]> {
|
||||
async findByPaymentMethod(restPaymentMethodId: string): Promise<RestaurantPaymentMethod[]> {
|
||||
return this.restaurantPaymentMethodRepository.find(
|
||||
{ paymentMethod: { id: paymentMethodId } },
|
||||
{ id: restPaymentMethodId },
|
||||
{ populate: ['restaurant', 'paymentMethod'] },
|
||||
);
|
||||
}
|
||||
@@ -91,14 +91,6 @@ export class RestaurantPaymentMethodService {
|
||||
): Promise<RestaurantPaymentMethod> {
|
||||
const restaurantPaymentMethod = await this.findOne(id);
|
||||
|
||||
if (updateRestaurantPaymentMethodDto.restaurantId) {
|
||||
const restaurant = await this.em.findOne(Restaurant, { id: updateRestaurantPaymentMethodDto.restaurantId });
|
||||
if (!restaurant) {
|
||||
throw new NotFoundException(`Restaurant with ID ${updateRestaurantPaymentMethodDto.restaurantId} not found`);
|
||||
}
|
||||
restaurantPaymentMethod.restaurant = restaurant;
|
||||
}
|
||||
|
||||
if (updateRestaurantPaymentMethodDto.paymentMethodId) {
|
||||
const paymentMethod = await this.em.findOne(PaymentMethod, {
|
||||
id: updateRestaurantPaymentMethodDto.paymentMethodId,
|
||||
|
||||
Reference in New Issue
Block a user