forked from verdnatura/salix-front
refs #6943 add try catch
This commit is contained in:
parent
d08748b1a4
commit
bcdd6965e6
|
@ -167,15 +167,19 @@ const getSamples = async () => {
|
||||||
|
|
||||||
getSamples();
|
getSamples();
|
||||||
const onDataSaved = async () => {
|
const onDataSaved = async () => {
|
||||||
const params = {
|
try {
|
||||||
recipientId: initialData.recipientId,
|
const params = {
|
||||||
recipient: initialData.recipient,
|
recipientId: initialData.recipientId,
|
||||||
replyTo: initialData.replyTo,
|
recipient: initialData.recipient,
|
||||||
};
|
replyTo: initialData.replyTo,
|
||||||
setParams(params);
|
};
|
||||||
const samplesData = await getSamples();
|
setParams(params);
|
||||||
const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`;
|
const samplesData = await getSamples();
|
||||||
await sendEmail(path, params);
|
const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`;
|
||||||
|
await sendEmail(path, params);
|
||||||
|
} catch (error) {
|
||||||
|
notify('errors.create', 'negative');
|
||||||
|
}
|
||||||
toCustomerSamples();
|
toCustomerSamples();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue