diff --git a/src/pages/Customer/Card/CustomerUnpaid.vue b/src/pages/Customer/Card/CustomerUnpaid.vue index f33f5d73a..265780517 100644 --- a/src/pages/Customer/Card/CustomerUnpaid.vue +++ b/src/pages/Customer/Card/CustomerUnpaid.vue @@ -43,14 +43,13 @@ watch( ); const getData = async (id) => { - const filter = { clientFk: id }; + const filter = { where: { clientFk: id } }; try { const { data } = await axios.get('ClientUnpaids', { params: { filter: JSON.stringify(filter) }, }); - const unpaid = data.find((element) => element.clientFk == id); - if (unpaid) { - setValues(unpaid); + if (data.length) { + setValues(data[0]); } else { defaultValues(); }