This commit is contained in:
2019-07-12 18:04:06 +00:00
parent c1aedd6a54
commit 323c2d8849
3 changed files with 8 additions and 12 deletions

View File

@@ -242,7 +242,7 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
//Create and validate
FormCustom o = await biz.CreateAsync(inObj);
if (o == null)

View File

@@ -59,8 +59,10 @@ namespace AyaNova.Biz
return null;
else
{
//do stuff with object
//
FormCustom outObj = inObj;
outObj.Template=JsonUtil.CompactJson(outObj.Template);
await ct.FormCustom.AddAsync(outObj);
await ct.SaveChangesAsync();
@@ -113,6 +115,8 @@ namespace AyaNova.Biz
if (HasErrors)
return false;
dbObj.Template=JsonUtil.CompactJson(dbObj.Template);
//Log modification
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);

View File

@@ -79,14 +79,6 @@ namespace AyaNova.Util
//WIDGET sample form customization
{
//?? Should the template be an object or an array at the top
//In other words is it correct below or in the TEST Project FormCustom code where it's directly an array
//verify what is coming out of the test project in json first before this
//According to the internet (:)) an array or an object is a valid top level json root object so it could go either way and it's a matter of preference I guess
var ct = ServiceProviderProvider.DBContext;
var fc = new FormCustom()
{
FormKey = "widget",
@@ -128,8 +120,8 @@ namespace AyaNova.Util
]"
};
ct.FormCustom.Add(fc);
ct.SaveChanges();
//Create and save to db
var res = FormCustomBiz.GetBizInternal(ServiceProviderProvider.DBContext).CreateAsync(fc).Result;
}
//Seed special test data for integration testing