feat: ajustado a entidade cliente
Deploy NestJS API / build-and-push-deploy (push) Successful in 3m44s Details

This commit is contained in:
joelson 2026-01-08 18:53:59 -03:00
parent 94f9208ee4
commit b330910fbf
1 changed files with 3 additions and 2 deletions

View File

@ -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);