This commit is contained in:
@@ -131,15 +131,14 @@ namespace AyaNova.Api.Controllers
|
||||
/// <summary>
|
||||
/// Put (update) FormCustom
|
||||
///
|
||||
/// Required roles:
|
||||
/// Any (public filter) or owned only (private filter)
|
||||
/// Required roles: BizAdminFull
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="formkey"></param>
|
||||
/// <param name="inObj"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutFormCustom([FromRoute] long id, [FromBody] FormCustom inObj)
|
||||
[HttpPut("{formkey}")]
|
||||
public async Task<IActionResult> PutFormCustom([FromRoute] string formkey, [FromBody] FormCustom inObj)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
@@ -150,7 +149,7 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
FormCustomBiz biz = FormCustomBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
var o = await biz.GetNoLogAsync(id);
|
||||
var o = await biz.GetNoLogAsync(formkey);
|
||||
if (o == null)
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
|
||||
@@ -164,7 +163,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!await biz.ExistsAsync(id))
|
||||
if (!await biz.ExistsAsync(formkey))
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
else
|
||||
return StatusCode(409, new ApiErrorResponse(ApiErrorCode.CONCURRENCY_CONFLICT));
|
||||
|
||||
Reference in New Issue
Block a user