This commit is contained in:
2020-01-22 00:34:54 +00:00
parent 3981e395d5
commit bee5fe85f9
6 changed files with 12 additions and 23 deletions

View File

@@ -11,16 +11,12 @@ using AyaNova.Biz;
namespace AyaNova.Api.Controllers
{
/// <summary>
/// Enum pick list controller
/// </summary>
[ApiController]
[ApiVersion("8.0")]
[Route("api/v{version:apiVersion}/[controller]")]
[Produces("application/json")]
[Authorize]
public class ObjectFieldsController : ControllerBase
public class FormFieldsDefinitionsController : ControllerBase
{
private readonly AyContext ct;
private readonly ILogger<AyaTypeController> log;
@@ -33,7 +29,7 @@ namespace AyaNova.Api.Controllers
/// <param name="dbcontext"></param>
/// <param name="logger"></param>
/// <param name="apiServerState"></param>
public ObjectFieldsController(AyContext dbcontext, ILogger<AyaTypeController> logger, ApiServerState apiServerState)
public FormFieldsDefinitionsController(AyContext dbcontext, ILogger<AyaTypeController> logger, ApiServerState apiServerState)
{
ct = dbcontext;
log = logger;
@@ -48,10 +44,10 @@ namespace AyaNova.Api.Controllers
/// Required roles: Any
///
/// </summary>
/// <param name="objectKey"></param>
/// <returns>List of fields and their properties</returns>
[HttpGet("ObjectFields/{objectKey}")]
public ActionResult GetObjectFields([FromRoute] string objectKey)
/// <param name="FormFieldDefinitionKey"></param>
/// <returns>List of form fields and their properties</returns>
[HttpGet("{FormFieldDefinitionKey}")]
public ActionResult GetFormFields([FromRoute] string FormFieldDefinitionKey)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -59,9 +55,9 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (AyaFormFieldDefinitions.IsValidFormFieldDefinitionKey(objectKey))
if (AyaFormFieldDefinitions.IsValidFormFieldDefinitionKey(FormFieldDefinitionKey))
{
return Ok(ApiOkResponse.Response(AyaFormFieldDefinitions.AyaObjectFields(objectKey), true));
return Ok(ApiOkResponse.Response(AyaFormFieldDefinitions.AyaFormFields(FormFieldDefinitionKey), true));
}
else
{