This commit is contained in:
@@ -183,13 +183,6 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
//save to get Id
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, o.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetLocale", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||
}
|
||||
}
|
||||
@@ -241,17 +234,12 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
@@ -311,17 +299,13 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
if (!biz.PutLocaleName(oFromDb, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
if (!biz.PutLocaleName(oFromDb, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user