From d059151a5500ab3bd22f2e69b8aa6405905b23c5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 29 Mar 2019 19:46:45 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 6 ++++++ ayanova/src/api/gzvalidate.js | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 4318fa4b..71fec149 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -14,6 +14,12 @@ TODO CLIENT STUFF 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 see the "bit sketchy but seems to work" bit Ensure a form-wide server validation error displays properly diff --git a/ayanova/src/api/gzvalidate.js b/ayanova/src/api/gzvalidate.js index 6d101807..80d1b981 100644 --- a/ayanova/src/api/gzvalidate.js +++ b/ayanova/src/api/gzvalidate.js @@ -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) - //{"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: @@ -340,12 +340,13 @@ return ret; ret = [err]; } else { //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 if (!v.$_.isEmpty(v.serverError.details)) { //See if this key is in the details array var errorsForField= v.$_.where(v.serverError.details, {target: ref}); 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 v.$_.each(errorsForField,function(ve){ var err="";