forked from verdnatura/salix-front
Solucion a comentarios 26
This commit is contained in:
parent
e56aa6587f
commit
93015d9f98
|
@ -43,14 +43,13 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
const getData = async (id) => {
|
const getData = async (id) => {
|
||||||
const filter = { clientFk: id };
|
const filter = { where: { clientFk: id } };
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get('ClientUnpaids', {
|
const { data } = await axios.get('ClientUnpaids', {
|
||||||
params: { filter: JSON.stringify(filter) },
|
params: { filter: JSON.stringify(filter) },
|
||||||
});
|
});
|
||||||
const unpaid = data.find((element) => element.clientFk == id);
|
if (data.length) {
|
||||||
if (unpaid) {
|
setValues(data[0]);
|
||||||
setValues(unpaid);
|
|
||||||
} else {
|
} else {
|
||||||
defaultValues();
|
defaultValues();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue