fix: mandatory error
(cherry picked from commit 4c70b1a06bff81aac6baacffe34d624c7e3c4b86)
This commit is contained in:
parent
47002deed6
commit
08243530e7
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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])
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user