This commit is contained in:
@@ -95,37 +95,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get available fields for form specified
|
||||
/// Used to build UI for customizing a form
|
||||
///
|
||||
/// Required roles:
|
||||
/// BizAdminFull only has rights to customize forms
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="formkey"></param>
|
||||
/// <returns>A single FormCustom</returns>
|
||||
[HttpGet("AvailableFields/{formkey}")]
|
||||
public ActionResult GetAvailableFields([FromRoute] string formkey)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
if (ObjectFields.IsValidObjectKey(formkey))
|
||||
{
|
||||
return Ok(ApiOkResponse.Response(ObjectFields.ObjectFields(formkey), true));
|
||||
}
|
||||
else
|
||||
{
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user