This commit is contained in:
@@ -176,11 +176,12 @@ namespace AyaNova.Api.Controllers
|
||||
/// Change existing work order's Contract
|
||||
/// applies new Contract and returns complete updated work order
|
||||
/// </summary>
|
||||
/// <param name="workOrderId">Work order id</param>
|
||||
/// <param name="newContractId">new contract id</param>
|
||||
/// <param name="apiVersion">From route path</param>
|
||||
/// <returns>WorkOrder</returns>
|
||||
[HttpPost("contract")]
|
||||
public async Task<IActionResult> ChangeContract([FromBody] long? newContractId, ApiVersion apiVersion)
|
||||
[HttpPost("contract/{workOrderId}")]
|
||||
public async Task<IActionResult> ChangeContract([FromRoute] long workOrderId, [FromBody] long? newContractId, ApiVersion apiVersion)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -189,7 +190,7 @@ namespace AyaNova.Api.Controllers
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
WorkOrder o = await biz.ChangeContract(newContractId);
|
||||
WorkOrder o = await biz.ChangeContract(workOrderId, newContractId);
|
||||
if (o == null)
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user