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