This commit is contained in:
@@ -67,10 +67,10 @@ namespace AyaNova.Api.Controllers
|
||||
/// <summary>
|
||||
/// PUT Global biz settings
|
||||
/// </summary>
|
||||
/// <param name="global"></param>
|
||||
/// <returns>nothing</returns>
|
||||
/// <param name="updatedObject"></param>
|
||||
/// <returns>New concurrency token</returns>
|
||||
[HttpPut]
|
||||
public async Task<IActionResult> ReplaceGlobalBizSettings([FromBody] GlobalBizSettings global)
|
||||
public async Task<IActionResult> ReplaceGlobalBizSettings([FromBody] GlobalBizSettings updatedObject)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -84,16 +84,10 @@ namespace AyaNova.Api.Controllers
|
||||
if (!Authorized.HasModifyRole(HttpContext.Items, biz.BizType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
try
|
||||
{
|
||||
if (!await biz.ReplaceAsync(global))
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
return StatusCode(409, new ApiErrorResponse(ApiErrorCode.CONCURRENCY_CONFLICT));
|
||||
}
|
||||
return NoContent();
|
||||
var o = await biz.PutAsync(updatedObject);//In future may need to return entire object, for now just concurrency token
|
||||
if (o == null)
|
||||
return StatusCode(409, new ApiErrorResponse(biz.Errors));
|
||||
return Ok(ApiOkResponse.Response(new { Concurrency = o.Concurrency }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user