This commit is contained in:
@@ -84,6 +84,32 @@ namespace AyaNova.Api.Controllers
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a single item's name display in PickList templated format
|
||||
/// </summary>
|
||||
/// <param name="pickListSingleParams"></param>
|
||||
/// <returns>One display string or an empty string if not found or invalid</returns>
|
||||
[HttpPost("single")]
|
||||
public async Task<IActionResult> PostSingle([FromBody] PickListSingleOptions pickListSingleParams)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
if (!Authorized.HasSelectRole(HttpContext.Items, pickListSingleParams.AyaType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
//Instantiate the business object handler
|
||||
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
var o = await biz.GetTemplatedNameAsync(pickListSingleParams.AyaType, pickListSingleParams.Id, pickListSingleParams.ListVariant, log);
|
||||
if (o == null)
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
else
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user