Skip to content

Commit

Permalink
handle format delete conflict (#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Oct 24, 2024
1 parent 3e1843a commit 7a237d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/resources/js/components/FormatDeleteForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
await RootServerApi.deleteFormat(deleteFormat.id);
},
onError: async (error) => {
await RootServerApi.handleErrors(error as Error);
await RootServerApi.handleErrors(error as Error, {
handleConflictError: () => {
confirmed = false;
errorMessage = $translations.formatDeleteConflictError;
}
});
spinner.hide();
},
onSuccess: () => {
Expand Down
2 changes: 2 additions & 0 deletions src/resources/js/stores/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const strings = new LocalizedStrings({
emailTitle: 'E-Mail-Adresse',
extraInfoTitle: 'Extra Info', // TODO: translate
filter: 'Filter', // TODO: translate
formatDeleteConflictError: 'Error: The format could not be deleted because it is still associated with meetings.', // TODO: translate
formatId: 'Format ID', // TODO: translate
formatsTitle: 'Formate',
formatTypeCodes: [
Expand Down Expand Up @@ -248,6 +249,7 @@ const strings = new LocalizedStrings({
emailTitle: 'Email',
extraInfoTitle: 'Extra Info',
filter: 'Filter',
formatDeleteConflictError: 'Error: The format could not be deleted because it is still associated with meetings.',
formatId: 'Format ID',
formatsTitle: 'Formats',
formatTypeCodes: [
Expand Down

0 comments on commit 7a237d8

Please sign in to comment.