This commit is contained in:
@@ -73,8 +73,6 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// List of all DataList keys available
|
||||
///
|
||||
@@ -92,5 +90,30 @@ namespace AyaNova.Api.Controllers
|
||||
return Ok(ApiOkResponse.Response(DataListFactory.GetListOfAllDataListKeyNames(), true));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// List of all fields for data list key specified
|
||||
///
|
||||
/// Required roles: Any
|
||||
/// </summary>
|
||||
/// <returns>List of DataListFieldDefinition</returns>
|
||||
[HttpGet("ListFields")]
|
||||
public ActionResult GetDataListFields([FromQuery] string DataListKey)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
{
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
}
|
||||
|
||||
var DataList = DataListFactory.GetAyaDataList(DataListKey);
|
||||
//was the name not found as a list?
|
||||
if (DataList == null)
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "DataListKey", $"DataList \"{DataListKey}\" specified does not exist"));
|
||||
}
|
||||
|
||||
return Ok(ApiOkResponse.Response(DataList.FieldDefinitions, true));
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//ens
|
||||
Reference in New Issue
Block a user