This commit is contained in:
@@ -496,6 +496,24 @@ export default {
|
||||
//First let's get the top level error code
|
||||
|
||||
let apiErrorCode = parseInt(vm.formState.serverError.code);
|
||||
//Not all server errors mean the form is invalid, exceptions here
|
||||
let formValid = false;
|
||||
/*
|
||||
These errors are not the user's fault and no changes to the form are required
|
||||
so they may be temporary and user should be able to retry save
|
||||
API_CLOSED = 2000,
|
||||
API_OPS_ONLY = 2001,
|
||||
API_SERVER_ERROR = 2002,
|
||||
*/
|
||||
switch (apiErrorCode) {
|
||||
case 2000:
|
||||
case 2001:
|
||||
case 2002:
|
||||
formValid = true; //we came here because the user saved because the form was valid so it's safe to set that the same again
|
||||
break;
|
||||
default:
|
||||
formValid = false;
|
||||
}
|
||||
|
||||
//GENERAL ERROR
|
||||
if (ref == "errorbox") {
|
||||
@@ -504,10 +522,11 @@ export default {
|
||||
if (vm.formState.serverError.message) {
|
||||
err = err + "\r\n" + vm.formState.serverError.message;
|
||||
}
|
||||
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
valid: false
|
||||
valid: formValid
|
||||
});
|
||||
ret.push(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user