This commit is contained in:
2021-01-19 21:47:30 +00:00
parent f78ed5e590
commit 8a52b60f2a
7 changed files with 68 additions and 12 deletions

View File

@@ -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));
}
//------------