This commit is contained in:
2019-03-29 19:46:45 +00:00
parent 237b085f7c
commit d059151a55
2 changed files with 9 additions and 2 deletions

View File

@@ -14,6 +14,12 @@ TODO CLIENT STUFF
TODO NEXT TODO NEXT
Happy Monday muthafucka! ;)
*** Add *all* api error codes to localized text over in the server project
*** Continue on with below, was at gzvalidate see area that says *****THIS!
Get broken server rule to display in vue properly Get broken server rule to display in vue properly
see the "bit sketchy but seems to work" bit see the "bit sketchy but seems to work" bit
Ensure a form-wide server validation error displays properly Ensure a form-wide server validation error displays properly

View File

@@ -264,7 +264,7 @@ When the form is submitted all server errors cleared if any from previous submit
//example error when submit when there are no roles set at all (blank) //example error when submit when there are no roles set at all (blank)
//{"error":{"code":"2200","details":[{"code":"2200","message":"","target":"roles","error":"VALIDATION_FAILED"}],"message":"Object did not pass validation"}} //{"error":{"code":"2200","details":[{"target":"WidgetCustom1","error":"2204"}],"message":"Object did not pass validation"}}
Here are all the API level error codes that can be returned by the API server: Here are all the API level error codes that can be returned by the API server:
@@ -340,12 +340,13 @@ return ret;
ret = [err]; ret = [err];
} else { } else {
//FIELD ERROR //FIELD ERROR
//{"error":{"code":"2200","details":[{"code":"2200","message":"","target":"roles","error":"VALIDATION_FAILED"}],"message":"Object did not pass validation"}} //{"error":{"code":"2200","details":[{"message":"Exception: Error converting value \"\" to type 'AyaNova.Biz.AuthorizationRoles'. Path 'roles', line 1, position 141.","target":"roles","error":"2203"}],"message":"Object did not pass validation"}}
//Specific field validation errors are in an array in "details" key //Specific field validation errors are in an array in "details" key
if (!v.$_.isEmpty(v.serverError.details)) { if (!v.$_.isEmpty(v.serverError.details)) {
//See if this key is in the details array //See if this key is in the details array
var errorsForField= v.$_.where(v.serverError.details, {target: ref}); var errorsForField= v.$_.where(v.serverError.details, {target: ref});
if(errorsForField.length>0){ if(errorsForField.length>0){
*****THIS!
//iterate the errorsForField objects, build a return message for each error separated by a newline and Bob's your lobster //iterate the errorsForField objects, build a return message for each error separated by a newline and Bob's your lobster
v.$_.each(errorsForField,function(ve){ v.$_.each(errorsForField,function(ve){
var err=""; var err="";