From b330910fbf88901e82bff9aeeeb0b8dfe622eef0 Mon Sep 17 00:00:00 2001 From: joelson Date: Thu, 8 Jan 2026 18:53:59 -0300 Subject: [PATCH] feat: ajustado a entidade cliente --- src/sales/customer/customer.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sales/customer/customer.service.ts b/src/sales/customer/customer.service.ts index b7ed1ba..3d91445 100644 --- a/src/sales/customer/customer.service.ts +++ b/src/sales/customer/customer.service.ts @@ -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);