feat: ajustado a entidade cliente
Deploy NestJS API / build-and-push-deploy (push) Successful in 3m44s
Details
Deploy NestJS API / build-and-push-deploy (push) Successful in 3m44s
Details
This commit is contained in:
parent
94f9208ee4
commit
b330910fbf
|
|
@ -360,8 +360,9 @@ export class CustomerService {
|
|||
newCustomer.longitude = customer.longitude;
|
||||
newCustomer.tipoendereco = customer.addressType;
|
||||
|
||||
const oldCustomer = await this.findCustomerByCpf(newCustomer.cgcent);
|
||||
if (oldCustomer) {
|
||||
const oldCustomers = await this.findCustomerByCpf(newCustomer.cgcent);
|
||||
if (oldCustomers && oldCustomers.length > 0) {
|
||||
const oldCustomer = oldCustomers[0];
|
||||
console.log('Cliente localizado: ' + oldCustomer.customerId);
|
||||
newCustomer.codcli = oldCustomer.customerId;
|
||||
await this.updateCustomer(newCustomer);
|
||||
|
|
|
|||
Loading…
Reference in New Issue