diff --git a/frontend/src/components/Modals/AddressModal.vue b/frontend/src/components/Modals/AddressModal.vue index 444490c4..c1e9ba20 100644 --- a/frontend/src/components/Modals/AddressModal.vue +++ b/frontend/src/components/Modals/AddressModal.vue @@ -121,7 +121,10 @@ const callBacks = { loading.value = false if (err.exc_type == 'MandatoryError') { const errorMessage = err.messages - .map((msg) => msg.split(': ')[2].trim()) + .map((msg) => { + let arr = msg.split(': ') + return arr[arr.length - 1].trim() + }) .join(', ') error.value = __('These fields are required: {0}', [errorMessage]) return diff --git a/frontend/src/components/Modals/CallLogModal.vue b/frontend/src/components/Modals/CallLogModal.vue index 1c90541f..dab2374c 100644 --- a/frontend/src/components/Modals/CallLogModal.vue +++ b/frontend/src/components/Modals/CallLogModal.vue @@ -124,7 +124,10 @@ const callBacks = { loading.value = false if (err.exc_type == 'MandatoryError') { const errorMessage = err.messages - .map((msg) => msg.split(': ')[2].trim()) + .map((msg) => { + let arr = msg.split(': ') + return arr[arr.length - 1].trim() + }) .join(', ') error.value = __('These fields are required: {0}', [errorMessage]) return diff --git a/frontend/src/data/document.js b/frontend/src/data/document.js index 9c15e1d0..d5893552 100644 --- a/frontend/src/data/document.js +++ b/frontend/src/data/document.js @@ -26,7 +26,10 @@ export function useDocument(doctype, docname) { let errorMessage = __('Error updating document') if (err.exc_type == 'MandatoryError') { const fieldName = err.messages - .map((msg) => msg.split(': ')[2].trim()) + .map((msg) => { + let arr = msg.split(': ') + return arr[arr.length - 1].trim() + }) .join(', ') errorMessage = __('Mandatory field error: {0}', [fieldName]) }