This commit is contained in:
2020-03-17 17:49:04 +00:00
parent 514ac54c3d
commit 63c278014f

View File

@@ -102,7 +102,7 @@ namespace AyaNova.Api.Controllers
/// <param name="ayaType"></param>
/// <returns>The current effective template, either a customized one or the default</returns>
[HttpGet("Template/{ayatype}")]
public async Task<IActionResult> GetDataListView([FromRoute] AyaType ayaType)
public async Task<IActionResult> GetPickListTemplate([FromRoute] AyaType ayaType)
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -220,6 +220,26 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// List of all fields for pick list AyaType specified
/// </summary>
/// <returns>List of fields available for template</returns>
[HttpGet("Template/ListFields/{ayatype}")]
public ActionResult GetPickListFields([FromRoute] AyaType ayaType)
{
if (!serverState.IsOpen)
{
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
}
var PickList = PickListFactory.GetAyaPickList(ayaType);
//type might not be supported
if (PickList == null)
{
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "ayatype", $"PickList for type \"{ayaType.ToString()}\" not supported"));
}
return Ok(ApiOkResponse.Response(PickList.ColumnDefinitions, true));
}