This commit is contained in:
@@ -242,7 +242,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
|
||||||
//Create and validate
|
//Create and validate
|
||||||
FormCustom o = await biz.CreateAsync(inObj);
|
FormCustom o = await biz.CreateAsync(inObj);
|
||||||
if (o == null)
|
if (o == null)
|
||||||
|
|||||||
@@ -59,8 +59,10 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//do stuff with object
|
//
|
||||||
FormCustom outObj = inObj;
|
FormCustom outObj = inObj;
|
||||||
|
|
||||||
|
outObj.Template=JsonUtil.CompactJson(outObj.Template);
|
||||||
|
|
||||||
await ct.FormCustom.AddAsync(outObj);
|
await ct.FormCustom.AddAsync(outObj);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
@@ -113,6 +115,8 @@ namespace AyaNova.Biz
|
|||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|||||||
@@ -79,14 +79,6 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//WIDGET sample form customization
|
//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()
|
var fc = new FormCustom()
|
||||||
{
|
{
|
||||||
FormKey = "widget",
|
FormKey = "widget",
|
||||||
@@ -128,8 +120,8 @@ namespace AyaNova.Util
|
|||||||
]"
|
]"
|
||||||
};
|
};
|
||||||
|
|
||||||
ct.FormCustom.Add(fc);
|
//Create and save to db
|
||||||
ct.SaveChanges();
|
var res = FormCustomBiz.GetBizInternal(ServiceProviderProvider.DBContext).CreateAsync(fc).Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Seed special test data for integration testing
|
//Seed special test data for integration testing
|
||||||
|
|||||||
Reference in New Issue
Block a user