This commit is contained in:
2020-01-15 18:52:18 +00:00
parent 8c574152e8
commit de08030b37
6 changed files with 39 additions and 22 deletions

View File

@@ -63,6 +63,19 @@ namespace AyaNova.Api.Controllers
switch (enumkey)
{
case "datatypes":
{
//Iterate the enum and get the values
Type t = typeof(AyaDataType);
Enum.GetName(t, AyaDataType.NoType);
foreach (var dt in Enum.GetValues(t))
{
ReturnList.Add(new NameIdItem() { Name = Enum.GetName(t, dt), Id = (long) dt });
}
}
break;
case "usertypes":
{
LocaleKeysToFetch.Add("UserTypesAdministrator");
@@ -160,6 +173,7 @@ namespace AyaNova.Api.Controllers
ret.Add(new KeyValuePair<string, string>("usertypes", "AyaNova user account types"));
ret.Add(new KeyValuePair<string, string>("authorizationroles", "AyaNova user account role types"));
ret.Add(new KeyValuePair<string, string>("AyaType", "All AyaNova object types, use the AyaTypeController route to fetch these"));
ret.Add(new KeyValuePair<string, string>("datatypes", "Types of data used in AyaNova for display and formatting UI purposes"));
return Ok(ApiOkResponse.Response(ret, true));
}

View File

@@ -102,12 +102,14 @@ namespace AyaNova.Api.Controllers
/// <summary>
/// Get available types allowed for Custom fields
/// Used to build UI for customizing a form
/// These values are a subset of the AyaDataTypes values
/// which can be fetched from the EnumPickList route
///
/// Required roles:
/// BizAdminFull only has rights to customize forms
///
/// </summary>
/// <returns>A list of type string values valid for custom fields</returns>
/// <returns>A list of valid values for custom field types</returns>
[HttpGet("AvailableCustomTypes")]
public ActionResult GetAvailableCustomTypes()
{