This commit is contained in:
2018-10-08 18:24:55 +00:00
parent 40dc278310
commit d58ede8fd3
2 changed files with 4 additions and 21 deletions

View File

@@ -291,14 +291,14 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
var dbObj = await biz.GetNoLogAsync(id);
if (dbObj == null)
var o = await biz.GetNoLogAsync(id);
if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
if (!Authorized.IsAuthorizedToDelete(HttpContext.Items, biz.BizType, dbObj.OwnerId))
if (!Authorized.IsAuthorizedToDelete(HttpContext.Items, biz.BizType, o.OwnerId))
return StatusCode(401, new ApiNotAuthorizedResponse());
if (!biz.Delete(dbObj))
if (!biz.Delete(o))
return BadRequest(new ApiErrorResponse(biz.Errors));
return NoContent();