This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user