refs #6943 remake, refactor, clean code Samples #677

Merged
carlossa merged 5 commits from 6943-fixCustomerSamples into master 2024-09-05 09:57:21 +00:00
1 changed files with 9 additions and 5 deletions
Showing only changes of commit 61c0f63eaf - Show all commits

View File

@ -158,11 +158,15 @@ const onSubmit = async () => {
};
const getSamples = async () => {
const filter = { where: { id: initialData.typeFk } };
let { data } = await axios.get('Samples', {
params: { filter: JSON.stringify(filter) },
});
return data[0];
try {
const filter = { where: { id: initialData.typeFk } };
let { data } = await axios.get('Samples', {
params: { filter: JSON.stringify(filter) },
});
carlossa marked this conversation as resolved Outdated

Si falla la peticion o data es nullo, que pasará?

Si falla la peticion o data es nullo, que pasará?
return data[0];
} catch (error) {
notify('errors.create', 'negative');
}
};
getSamples();