0
0
Fork 0

Solucion a comentarios 26

This commit is contained in:
carlosfonseca 2024-02-28 08:28:46 -05:00
parent e56aa6587f
commit 93015d9f98
1 changed files with 3 additions and 4 deletions

View File

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