This commit is contained in:
@@ -221,6 +221,13 @@ export default {
|
|||||||
// SERVER ERRORS
|
// SERVER ERRORS
|
||||||
// Process and return server errors if any for form and field specified
|
// Process and return server errors if any for form and field specified
|
||||||
ServerErrors(v, ref) {
|
ServerErrors(v, ref) {
|
||||||
|
//CHECK PREREQUISITES IN DEV MODE TO ENSURE FORM ISN"T MISSING NEEDE DATA ATTRIBUTES ETC
|
||||||
|
if (v.$gzdevmode()) {
|
||||||
|
//make sure serverErrors is defined on data
|
||||||
|
if (!v$_.has(v, "serverError")) {
|
||||||
|
throw "DEV ERROR: serverError seems to be missing from form's vue data object";
|
||||||
|
}
|
||||||
|
}
|
||||||
//OK, this is sketchy a bit but seems to work
|
//OK, this is sketchy a bit but seems to work
|
||||||
//If it returns a value that is displayed as an error in the field (hides any rule errors but whatever)
|
//If it returns a value that is displayed as an error in the field (hides any rule errors but whatever)
|
||||||
//Tested and confirmed that If I make a change to the underlying data property that is housing the data used here to determine if a field has an error, and remove that error then it instantly resolves in the UI and removes the message so that's good!
|
//Tested and confirmed that If I make a change to the underlying data property that is housing the data used here to determine if a field has an error, and remove that error then it instantly resolves in the UI and removes the message so that's good!
|
||||||
@@ -297,14 +304,11 @@ Here are all the API level error codes that can be returned by the API server:
|
|||||||
}
|
}
|
||||||
var apiErrorCode = parseInt(v.serverError.code);
|
var apiErrorCode = parseInt(v.serverError.code);
|
||||||
|
|
||||||
|
|
||||||
//General form errors?
|
//General form errors?
|
||||||
if (ref == "apierrors" && apiErrorCode < 2201) {
|
if (ref == "apierrors" && apiErrorCode < 2201) {
|
||||||
//we have a general error, format for return
|
//we have a general error, format for return
|
||||||
// "ErrorFieldValueNotInteger": "Value must be an integer"
|
// "ErrorFieldValueNotInteger": "Value must be an integer"
|
||||||
var err = v.$gzlocale.get("ErrorAPI"+ apiErrorCode.toString());
|
var err = v.$gzlocale.get("ErrorAPI" + apiErrorCode.toString());
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Specific field errors
|
//Specific field errors
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user