fix: remove useless try catch
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-12-17 07:02:44 +01:00
parent 98674e528c
commit a3ea359b01
1 changed files with 6 additions and 16 deletions

View File

@ -16,24 +16,14 @@ const actions = {
clone: async () => { clone: async () => {
const opts = { message: t('Zone cloned'), type: 'positive' }; const opts = { message: t('Zone cloned'), type: 'positive' };
try { const { data } = await axios.post(`Zones/${zoneId}/clone`, {});
const { data } = await axios.post(`Zones/${zoneId}/clone`, {}); notify(opts);
notify(opts); push(`/zone/${data.id}/basic-data`);
push(`/zone/${data.id}/basic-data`);
} catch (e) {
opts.message = t('It was not able to clone the zone');
opts.type = 'negative';
}
}, },
remove: async () => { remove: async () => {
try { await axios.post(`Zones/${zoneId}/deleteZone`);
await axios.post(`Zones/${zoneId}/deleteZone`); notify({ message: t('Zone deleted'), type: 'positive' });
push({ name: 'ZoneList' });
notify({ message: t('Zone deleted'), type: 'positive' });
push({ name: 'ZoneList' });
} catch (e) {
notify({ message: e.message, type: 'negative' });
}
}, },
}; };
function openConfirmDialog(callback) { function openConfirmDialog(callback) {