This commit is contained in:
2019-11-28 16:38:19 +00:00
parent e855d9230d
commit 8e8406ba87
2 changed files with 13 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ namespace AyaNova.Biz
// //
FormCustom outObj = inObj; FormCustom outObj = inObj;
outObj.Template=JsonUtil.CompactJson(outObj.Template); outObj.Template = JsonUtil.CompactJson(outObj.Template);
await ct.FormCustom.AddAsync(outObj); await ct.FormCustom.AddAsync(outObj);
await ct.SaveChangesAsync(); await ct.SaveChangesAsync();
@@ -115,7 +115,7 @@ namespace AyaNova.Biz
if (HasErrors) if (HasErrors)
return false; return false;
dbObj.Template=JsonUtil.CompactJson(dbObj.Template); dbObj.Template = JsonUtil.CompactJson(dbObj.Template);
//Log modification //Log modification
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
@@ -218,9 +218,10 @@ namespace AyaNova.Biz
} }
//validate if it's a custom field that it has a type specified //validate if it's a custom field that it has a type specified
if (MasterFormField.Custom && formFieldItem["type"]==null){ if (MasterFormField.Custom && formFieldItem["type"] == null)
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is MISSING for custom filed, Custom fields MUST have types specified"); {
} AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is MISSING for custom filed, Custom fields MUST have types specified");
}
@@ -238,7 +239,7 @@ namespace AyaNova.Biz
} }
TODO: why is required required if it's just a regular field being hidden? //other code depends on seeing the required value even if it's not set to true
if (formFieldItem["required"] == null) if (formFieldItem["required"] == null)
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, object is missing required \"required\" property "); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Template", $"Template array item {i}, object is missing required \"required\" property ");

View File

@@ -89,6 +89,7 @@ namespace AyaNova.Util
}, },
{ {
""fld"": ""WidgetSerial"", ""fld"": ""WidgetSerial"",
""required"": ""false"",
""hide"": ""true"" ""hide"": ""true""
}, },
{ {