This commit is contained in:
@@ -127,12 +127,11 @@ namespace AyaNova.Api.Controllers
|
||||
/// <summary>
|
||||
/// Put (update) WorkOrder
|
||||
/// (Descendent objects must be updated via their individual routes seperately)
|
||||
/// </summary>
|
||||
/// <param name="id">WorkOrder id</param>
|
||||
/// </summary>
|
||||
/// <param name="updatedObject">WorkOrder - top level only, no descendents</param>
|
||||
/// <returns>New concurrency token</returns>
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutWorkOrder([FromRoute] long id, [FromBody] dtWorkOrder updatedObject)
|
||||
[HttpPut]
|
||||
public async Task<IActionResult> PutWorkOrder([FromBody] dtWorkOrder updatedObject)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -141,7 +140,7 @@ namespace AyaNova.Api.Controllers
|
||||
WorkOrderBiz biz = WorkOrderBiz.GetBiz(ct, HttpContext);
|
||||
if (!Authorized.HasModifyRole(HttpContext.Items, biz.BizType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
var o = await biz.PutAsync(id, updatedObject);//In future may need to return entire object, for now just concurrency token
|
||||
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(m => m.Code == ApiErrorCode.CONCURRENCY_CONFLICT))
|
||||
|
||||
Reference in New Issue
Block a user