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 () => {
|
||||
try {
|
||||
const filter = { where: { id: initialData.typeFk } };
|
||||
let { data } = await axios.get('Samples', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
return data[0];
|
||||
} catch (error) {
|
||||
notify('errors.create', 'negative');
|
||||
}
|
||||
};
|
||||
|
||||
getSamples();
|
||||
|
|
Loading…
Reference in New Issue