This commit is contained in:
2019-12-10 20:57:33 +00:00
parent d602e20b00
commit 0c06bdeef0
3 changed files with 28 additions and 22 deletions

View File

@@ -58,7 +58,7 @@ namespace AyaNova.Api.Controllers
/// <param name="formkey">The official form key used by AyaNova</param>
/// <param name="concurrencyToken">A prior concurrency token used to check if there are any changes without using up bandwidth sending unnecessary data</param>
/// <returns>A single FormCustom or nothing and a header 304 not modified</returns>
[HttpGet("{formkey}")]
[HttpGet("{formkey}")]
public async Task<IActionResult> GetFormCustom([FromRoute] string formkey, [FromQuery] uint? concurrencyToken)
{
if (serverState.IsClosed)
@@ -127,28 +127,30 @@ namespace AyaNova.Api.Controllers
}
}
// /// <summary>
// /// Get available types allowed for Custom fields
// /// Used to build UI for customizing a form
// ///
// /// Required roles:
// /// BizAdminFull only has rights to customize forms
// ///
// /// </summary>
// /// <returns>A list of type string values valid for custom fields</returns>
// [HttpGet("AvailableCustomTypes")]
// public ActionResult GetAvailableCustomTypes()
// {
// 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));
// return Ok(ApiOkResponse.Response(CustomFieldType.ValidCustomFieldTypes, true));
// }
/// <summary>
/// Get available types allowed for Custom fields
/// Used to build UI for customizing a form
///
/// Required roles:
/// BizAdminFull only has rights to customize forms
///
/// </summary>
/// <returns>A list of type string values valid for custom fields</returns>
[HttpGet("AvailableCustomTypes")]
public ActionResult GetAvailableCustomTypes()
{
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));
return Ok(ApiOkResponse.Response(CustomFieldType.ValidCustomFieldTypes, true));
}
/// <summary>
@@ -244,7 +246,7 @@ namespace AyaNova.Api.Controllers
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// //Create and validate
// FormCustom o = await biz.CreateAsync(inObj);
// if (o == null)