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.longitude = customer.longitude;
|
||||||
newCustomer.tipoendereco = customer.addressType;
|
newCustomer.tipoendereco = customer.addressType;
|
||||||
|
|
||||||
const oldCustomer = await this.findCustomerByCpf(newCustomer.cgcent);
|
const oldCustomers = await this.findCustomerByCpf(newCustomer.cgcent);
|
||||||
if (oldCustomer) {
|
if (oldCustomers && oldCustomers.length > 0) {
|
||||||
|
const oldCustomer = oldCustomers[0];
|
||||||
console.log('Cliente localizado: ' + oldCustomer.customerId);
|
console.log('Cliente localizado: ' + oldCustomer.customerId);
|
||||||
newCustomer.codcli = oldCustomer.customerId;
|
newCustomer.codcli = oldCustomer.customerId;
|
||||||
await this.updateCustomer(newCustomer);
|
await this.updateCustomer(newCustomer);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue