refs #6943 remake, refactor, clean code Samples #677

Merged
carlossa merged 5 commits from 6943-fixCustomerSamples into master 2024-09-05 09:57:21 +00:00
1 changed files with 13 additions and 9 deletions
Showing only changes of commit bcdd6965e6 - Show all commits

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`;
carlossa marked this conversation as resolved Outdated

try/catch?

try/catch?
await sendEmail(path, params);
} catch (error) {
notify('errors.create', 'negative');
}
toCustomerSamples();
};