PR-CUSTOMER #186

Merged
jsegarra merged 105 commits from :PR-CUSTOMER into dev 2024-04-19 15:55:53 +00:00
1 changed files with 3 additions and 4 deletions
Showing only changes of commit 93015d9f98 - Show all commits
src/pages/Customer/Card

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) {
jsegarra marked this conversation as resolved Outdated

Porque haces un find por id, si ya lo has hecho en la query/filter? Te devoilverá el resultado
Si filtras por 1101, te llegará [1101]

Porque haces un find por id, si ya lo has hecho en la query/filter? Te devoilverá el resultado Si filtras por 1101, te llegará [1101]

Corregido: 93015d9f98

Corregido: 93015d9f98
setValues(data[0]);
jsegarra marked this conversation as resolved Outdated

Mi propuesta es si data.length>0

Mi propuesta es si data.length>0

Corregido: 93015d9f98

Corregido: 93015d9f98
} else {
defaultValues();
}