0
0
Fork 0

refs #6943 add try catch get

This commit is contained in:
Carlos Satorres 2024-09-04 14:46:21 +02:00
parent bcdd6965e6
commit 61c0f63eaf
1 changed files with 9 additions and 5 deletions

View File

@ -158,11 +158,15 @@ const onSubmit = async () => {
}; };
const getSamples = async () => { const getSamples = async () => {
const filter = { where: { id: initialData.typeFk } }; try {
let { data } = await axios.get('Samples', { const filter = { where: { id: initialData.typeFk } };
params: { filter: JSON.stringify(filter) }, let { data } = await axios.get('Samples', {
}); params: { filter: JSON.stringify(filter) },
return data[0]; });
return data[0];
} catch (error) {
notify('errors.create', 'negative');
}
}; };
getSamples(); getSamples();