This commit is contained in:
@@ -190,17 +190,18 @@ namespace AyaNova.Api.Controllers
|
||||
PartBiz biz = PartBiz.GetBiz(ct, HttpContext);
|
||||
if (!Authorized.HasModifyRole(HttpContext.Items, biz.BizType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
var v = await ct.SaveChangesAsync();
|
||||
return Accepted();
|
||||
// var o = await biz.PutAsync(updatedObject);//In future may need to return entire object, for now just concurrency token
|
||||
// if (o == null)
|
||||
// {
|
||||
// if (biz.Errors.Exists(z => z.Code == ApiErrorCode.CONCURRENCY_CONFLICT))
|
||||
// return StatusCode(409, new ApiErrorResponse(biz.Errors));
|
||||
// else
|
||||
// return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
// }
|
||||
// return Ok(ApiOkResponse.Response(new { Concurrency = o.Concurrency })); ;
|
||||
|
||||
|
||||
var o = await biz.PutSerialsAsync(id, serials);
|
||||
if (o == null)
|
||||
{
|
||||
if (biz.Errors.Exists(z => z.Code == ApiErrorCode.CONCURRENCY_CONFLICT))
|
||||
return StatusCode(409, new ApiErrorResponse(biz.Errors));
|
||||
else
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
}
|
||||
|
||||
//------------
|
||||
|
||||
Reference in New Issue
Block a user