0
0
Fork 0

refs #6943 add try catch

This commit is contained in:
Carlos Satorres 2024-09-04 14:43:48 +02:00
parent d08748b1a4
commit bcdd6965e6
1 changed files with 13 additions and 9 deletions

View File

@ -167,15 +167,19 @@ const getSamples = async () => {
getSamples();
const onDataSaved = async () => {
const params = {
recipientId: initialData.recipientId,
recipient: initialData.recipient,
replyTo: initialData.replyTo,
};
setParams(params);
const samplesData = await getSamples();
const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`;
await sendEmail(path, params);
try {
const params = {
recipientId: initialData.recipientId,
recipient: initialData.recipient,
replyTo: initialData.replyTo,
};
setParams(params);
const samplesData = await getSamples();
const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`;
await sendEmail(path, params);
} catch (error) {
notify('errors.create', 'negative');
}
toCustomerSamples();
};