forked from verdnatura/salix-front
refs #6943 add try catch get
This commit is contained in:
parent
bcdd6965e6
commit
61c0f63eaf
|
@ -158,11 +158,15 @@ const onSubmit = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSamples = async () => {
|
const getSamples = async () => {
|
||||||
|
try {
|
||||||
const filter = { where: { id: initialData.typeFk } };
|
const filter = { where: { id: initialData.typeFk } };
|
||||||
let { data } = await axios.get('Samples', {
|
let { data } = await axios.get('Samples', {
|
||||||
params: { filter: JSON.stringify(filter) },
|
params: { filter: JSON.stringify(filter) },
|
||||||
});
|
});
|
||||||
return data[0];
|
return data[0];
|
||||||
|
} catch (error) {
|
||||||
|
notify('errors.create', 'negative');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
getSamples();
|
getSamples();
|
||||||
|
|
Loading…
Reference in New Issue