Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle format delete conflict #1098

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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