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
|
loading.value = false
|
||||||
if (err.exc_type == 'MandatoryError') {
|
if (err.exc_type == 'MandatoryError') {
|
||||||
const errorMessage = err.messages
|
const errorMessage = err.messages
|
||||||
.map((msg) => msg.split(': ')[2].trim())
|
.map((msg) => {
|
||||||
|
let arr = msg.split(': ')
|
||||||
|
return arr[arr.length - 1].trim()
|
||||||
|
})
|
||||||
.join(', ')
|
.join(', ')
|
||||||
error.value = __('These fields are required: {0}', [errorMessage])
|
error.value = __('These fields are required: {0}', [errorMessage])
|
||||||
return
|
return
|
||||||
|
|||||||
@ -124,7 +124,10 @@ const callBacks = {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
if (err.exc_type == 'MandatoryError') {
|
if (err.exc_type == 'MandatoryError') {
|
||||||
const errorMessage = err.messages
|
const errorMessage = err.messages
|
||||||
.map((msg) => msg.split(': ')[2].trim())
|
.map((msg) => {
|
||||||
|
let arr = msg.split(': ')
|
||||||
|
return arr[arr.length - 1].trim()
|
||||||
|
})
|
||||||
.join(', ')
|
.join(', ')
|
||||||
error.value = __('These fields are required: {0}', [errorMessage])
|
error.value = __('These fields are required: {0}', [errorMessage])
|
||||||
return
|
return
|
||||||
|
|||||||
@ -26,7 +26,10 @@ export function useDocument(doctype, docname) {
|
|||||||
let errorMessage = __('Error updating document')
|
let errorMessage = __('Error updating document')
|
||||||
if (err.exc_type == 'MandatoryError') {
|
if (err.exc_type == 'MandatoryError') {
|
||||||
const fieldName = err.messages
|
const fieldName = err.messages
|
||||||
.map((msg) => msg.split(': ')[2].trim())
|
.map((msg) => {
|
||||||
|
let arr = msg.split(': ')
|
||||||
|
return arr[arr.length - 1].trim()
|
||||||
|
})
|
||||||
.join(', ')
|
.join(', ')
|
||||||
errorMessage = __('Mandatory field error: {0}', [fieldName])
|
errorMessage = __('Mandatory field error: {0}', [fieldName])
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user