Skip to content

Commit

Permalink
catch error and notify
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Jan 29, 2025
1 parent 13b8dc5 commit ccf4343
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions resources/js/components/forms/album/ConfirmSharingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ function propagate() {
shall_override: shallOverride.value,
};
SharingService.propagate(data).then(() => {
if (shallOverride.value) {
toast.add({ severity: "success", summary: trans("toasts.success"), detail: trans("sharing.permission_overwritten"), life: 3000 });
} else {
toast.add({ severity: "success", summary: trans("toasts.success"), detail: trans("sharing.permission_updated"), life: 3000 });
}
visible.value = false;
reset();
});
SharingService.propagate(data)
.then(() => {
if (shallOverride.value) {
toast.add({ severity: "success", summary: trans("toasts.success"), detail: trans("sharing.permission_overwritten"), life: 3000 });
} else {
toast.add({ severity: "success", summary: trans("toasts.success"), detail: trans("sharing.permission_updated"), life: 3000 });
}
visible.value = false;
reset();
})
.catch((error) => {
toast.add({ severity: "error", summary: error.response.data.message, life: 3000 });
});
}
</script>

0 comments on commit ccf4343

Please sign in to comment.