This commit is contained in:
2018-08-24 17:05:33 +00:00
parent 871182ebdb
commit 33626df512
8 changed files with 70 additions and 29 deletions

View File

@@ -161,6 +161,10 @@ namespace AyaNova.Api.Controllers
{
//save and success return
await ct.SaveChangesAsync();
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.Locale, AyaEvent.Created), ct);
return CreatedAtAction("GetLocale", new { id = o.Id }, new ApiCreatedResponse(o));
}
}
@@ -236,6 +240,9 @@ namespace AyaNova.Api.Controllers
}
}
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
return Ok(new ApiOkResponse(new { ConcurrencyToken = oFromDb.ConcurrencyToken }));
}
@@ -269,7 +276,7 @@ namespace AyaNova.Api.Controllers
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
}
if (!Authorized.IsAuthorizedToModify(HttpContext.Items, AyaType.Locale, oFromDb.OwnerId))
{
return StatusCode(401, new ApiNotAuthorizedResponse());
@@ -302,6 +309,9 @@ namespace AyaNova.Api.Controllers
}
}
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
return Ok(new ApiOkResponse(new { ConcurrencyToken = oFromDb.ConcurrencyToken }));
}
@@ -355,6 +365,9 @@ namespace AyaNova.Api.Controllers
//Delete children / attached objects
// biz.DeleteChildren(dbObj);
//Log
EventLogProcessor.DeleteObject(biz.userId, AyaType.Locale, dbObj.Id, dbObj.Name, ct);
return NoContent();
}