diff --git a/frontend/src/modules/member/components/list/member-list-toolbar.vue b/frontend/src/modules/member/components/list/member-list-toolbar.vue index 7ab2eeaea0..40e331040e 100644 --- a/frontend/src/modules/member/components/list/member-list-toolbar.vue +++ b/frontend/src/modules/member/components/list/member-list-toolbar.vue @@ -237,9 +237,17 @@ const handleMergeMembers = async () => { fetchMembers({ reload: true }); }) - .catch(() => { + .catch((error) => { Message.closeAll(); - Message.error('Error merging contacts'); + + if (error.response.status === 404) { + Message.error('Contacts already merged or deleted', { + message: `Sorry, the contacts you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging contacts'); + } }); }; diff --git a/frontend/src/modules/member/components/member-merge-dialog.vue b/frontend/src/modules/member/components/member-merge-dialog.vue index cc28ba2ad3..9b1b25e9c2 100644 --- a/frontend/src/modules/member/components/member-merge-dialog.vue +++ b/frontend/src/modules/member/components/member-merge-dialog.vue @@ -138,8 +138,15 @@ const mergeSuggestion = () => { fetchMembers({ reload: true }); } }) - .catch(() => { - Message.error('There was an error merging contacts'); + .catch((error) => { + if (error.response.status === 404) { + Message.error('Contacts already merged or deleted', { + message: `Sorry, the contacts you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging contacts'); + } }) .finally(() => { sendingMerge.value = false; diff --git a/frontend/src/modules/member/pages/member-merge-suggestions-page.vue b/frontend/src/modules/member/pages/member-merge-suggestions-page.vue index 71519822ee..38d7c9d130 100644 --- a/frontend/src/modules/member/pages/member-merge-suggestions-page.vue +++ b/frontend/src/modules/member/pages/member-merge-suggestions-page.vue @@ -266,8 +266,15 @@ const ignoreSuggestion = () => { Message.success('Merging suggestion ignored successfuly'); fetch(); }) - .catch(() => { - Message.error('There was an error ignoring the merging suggestion'); + .catch((error) => { + if (error.response.status === 404) { + Message.error('Suggestion already merged or ignored', { + message: `Sorry, the suggestion you are trying to merge might have already been merged or ignored. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error ignoring the merging suggestion'); + } }) .finally(() => { sendingIgnore.value = false; @@ -288,8 +295,15 @@ const mergeSuggestion = () => { Message.success('Contacts merged successfuly'); fetch(); }) - .catch(() => { - Message.error('There was an error merging contacts'); + .catch((error) => { + if (error.response.status === 404) { + Message.error('Contacts already merged or deleted', { + message: `Sorry, the contacts you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging contacts'); + } }) .finally(() => { sendingMerge.value = false; diff --git a/frontend/src/modules/organization/components/list/organization-list-toolbar.vue b/frontend/src/modules/organization/components/list/organization-list-toolbar.vue index 5196156b8a..e173886e08 100644 --- a/frontend/src/modules/organization/components/list/organization-list-toolbar.vue +++ b/frontend/src/modules/organization/components/list/organization-list-toolbar.vue @@ -192,9 +192,17 @@ const handleMergeOrganizations = async () => { fetchOrganizations({ reload: true }); }) - .catch(() => { + .catch((error) => { Message.closeAll(); - Message.error('There was an error merging organizations'); + + if (error.response.status === 404) { + Message.error('Organizations already merged or deleted', { + message: `Sorry, the organizations you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging organizations'); + } }); }; diff --git a/frontend/src/modules/organization/components/organization-merge-dialog.vue b/frontend/src/modules/organization/components/organization-merge-dialog.vue index 594a6c224a..2736acc574 100644 --- a/frontend/src/modules/organization/components/organization-merge-dialog.vue +++ b/frontend/src/modules/organization/components/organization-merge-dialog.vue @@ -155,9 +155,16 @@ const mergeSuggestion = () => { changeOrganization(); }) - .catch(() => { + .catch((error) => { Message.closeAll(); - Message.error('There was an error merging organizations'); + if (error.response.status === 404) { + Message.error('Organizations already merged or deleted', { + message: `Sorry, the organizations you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging organizations'); + } }) .finally(() => { sendingMerge.value = false; diff --git a/frontend/src/modules/organization/pages/organization-merge-suggestions-page.vue b/frontend/src/modules/organization/pages/organization-merge-suggestions-page.vue index 13af3cf488..0376c3cb0d 100644 --- a/frontend/src/modules/organization/pages/organization-merge-suggestions-page.vue +++ b/frontend/src/modules/organization/pages/organization-merge-suggestions-page.vue @@ -276,8 +276,15 @@ const ignoreSuggestion = () => { Message.success('Merging suggestion ignored successfuly'); fetch(); }) - .catch(() => { - Message.error('There was an error ignoring the merging suggestion'); + .catch((error) => { + if (error.response.status === 404) { + Message.error('Suggestion already merged or ignored', { + message: `Sorry, the suggestion you are trying to merge might have already been merged or ignored. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error ignoring the merging suggestion'); + } }) .finally(() => { sendingIgnore.value = false; @@ -313,9 +320,17 @@ const mergeSuggestion = () => { fetch(); }) - .catch((e) => { + .catch((error) => { Message.closeAll(); - Message.error('There was an error merging organizations'); + + if (error.response.status === 404) { + Message.error('Organizations already merged or deleted', { + message: `Sorry, the organizations you are trying to merge might have already been merged or deleted. + Please refresh to see the updated information.`, + }); + } else { + Message.error('There was an error merging organizations'); + } }) .finally(() => { sendingMerge.value = false;