remove graph
This commit is contained in:
@@ -2,8 +2,8 @@ import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
import { EntityManager } from '@mikro-orm/postgresql';
|
||||
import { PaymentMethod } from '../entities/payment-method.entity';
|
||||
import { PaymentMethodRepository } from '../repositories/payment-method.repository';
|
||||
import { CreatePaymentMethodInput } from '../dto/create-payment-method.input';
|
||||
import { UpdatePaymentMethodInput } from '../dto/update-payment-method.input';
|
||||
import { CreatePaymentMethodDto } from '../dto/create-payment-method.dto';
|
||||
import { UpdatePaymentMethodDto } from '../dto/update-payment-method.dto';
|
||||
import { RequiredEntityData } from '@mikro-orm/core';
|
||||
|
||||
@Injectable()
|
||||
@@ -13,9 +13,9 @@ export class PaymentMethodService {
|
||||
private readonly em: EntityManager,
|
||||
) {}
|
||||
|
||||
async create(createPaymentMethodInput: CreatePaymentMethodInput): Promise<PaymentMethod> {
|
||||
async create(createPaymentMethodDto: CreatePaymentMethodDto): Promise<PaymentMethod> {
|
||||
const paymentMethod = this.paymentMethodRepository.create(
|
||||
createPaymentMethodInput as unknown as RequiredEntityData<PaymentMethod>,
|
||||
createPaymentMethodDto as unknown as RequiredEntityData<PaymentMethod>,
|
||||
);
|
||||
await this.em.persistAndFlush(paymentMethod);
|
||||
return paymentMethod;
|
||||
@@ -33,9 +33,9 @@ export class PaymentMethodService {
|
||||
return paymentMethod;
|
||||
}
|
||||
|
||||
async update(id: string, updatePaymentMethodInput: UpdatePaymentMethodInput): Promise<PaymentMethod> {
|
||||
async update(id: string, updatePaymentMethodDto: UpdatePaymentMethodDto): Promise<PaymentMethod> {
|
||||
const paymentMethod = await this.findOne(id);
|
||||
this.em.assign(paymentMethod, updatePaymentMethodInput);
|
||||
this.em.assign(paymentMethod, updatePaymentMethodDto);
|
||||
await this.em.flush();
|
||||
return paymentMethod;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user