Skip to content

Commit

Permalink
Rework for loop into forEach, use promise instead of try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwong89 committed Oct 25, 2023
1 parent 8f3299c commit f8d9f4e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions frontend/src/components/object/DeleteObjectButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ const confirmDelete = () => {
acceptLabel: 'Confirm',
rejectLabel: 'Cancel',
accept: async () => {
for( const id of props.ids){
try {
await objectStore.deleteObject(id, props.versionId);
emit('on-deleted-success', props.versionId);
}
catch{
// intentionally left blank
}
}
props.ids?.forEach((id: string) => {
objectStore.deleteObject(id, props.versionId)
.then(() => emit('on-deleted-success', props.versionId))
.catch(() => { });
});
}
});
} else {
Expand Down

0 comments on commit f8d9f4e

Please sign in to comment.