This commit is contained in:
@@ -102,7 +102,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// <param name="ayaType"></param>
|
/// <param name="ayaType"></param>
|
||||||
/// <returns>The current effective template, either a customized one or the default</returns>
|
/// <returns>The current effective template, either a customized one or the default</returns>
|
||||||
[HttpGet("Template/{ayatype}")]
|
[HttpGet("Template/{ayatype}")]
|
||||||
public async Task<IActionResult> GetDataListView([FromRoute] AyaType ayaType)
|
public async Task<IActionResult> GetPickListTemplate([FromRoute] AyaType ayaType)
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (serverState.IsClosed)
|
||||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user