This commit is contained in:
@@ -13,8 +13,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
internal static class DataListFetcher
|
||||
{
|
||||
internal static async Task<ApiDataListResponse> GetResponseAsync(string DataListKey, AyContext ct, IUrlHelper Url,
|
||||
string routeName, ListOptions listOptions, long UserId, AuthorizationRoles UserRoles)
|
||||
internal static async Task<ApiDataListResponse> GetResponseAsync(string DataListKey, AyContext ct, ListOptions listOptions, long UserId, AuthorizationRoles UserRoles)
|
||||
{
|
||||
|
||||
// var AyaObjectFields = AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldDefinitions.TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY);
|
||||
@@ -26,7 +25,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
|
||||
//check rights
|
||||
if (listOptions.Mini)
|
||||
if (listOptions.Mini != null && listOptions.Mini == true)
|
||||
{
|
||||
if (!UserRoles.HasAnyFlags(DataList.MiniListAllowedRoles))
|
||||
throw new System.UnauthorizedAccessException("User roles insufficient for this mini format datalist");
|
||||
@@ -58,7 +57,7 @@ namespace AyaNova.DataList
|
||||
|
||||
//convert to strings array (https://stackoverflow.com/a/33836599/8939)
|
||||
string[] templateFieldList;
|
||||
if (listOptions.Mini)
|
||||
if (listOptions.Mini != null && listOptions.Mini == true)
|
||||
{
|
||||
templateFieldList = ((JArray)jtemplate["mini"]).ToObject<string[]>();
|
||||
}
|
||||
@@ -184,45 +183,10 @@ namespace AyaNova.DataList
|
||||
}
|
||||
}
|
||||
|
||||
//RES.PAGING.COUNT is all I need so the rest is moot, particularly since it's a post method now to get a datalist not a GET with query parameters
|
||||
//below commented stuff can go once it tests
|
||||
|
||||
//BUILD THE PAGING LINKS PORTION
|
||||
//var pageLinks = new PaginationLinkBuilder(Url, routeName, null, listOptions, totalRecordCount).PagingLinksObject();
|
||||
//http://localhost:7575/api/v8/DataList/List?Offset=2&Limit=3&DataFilterId=2&Mini=true&DataListKey=TestWidgetDataList
|
||||
|
||||
// object routeValues = null;
|
||||
// //no data filter?
|
||||
// if (listOptions.DataFilterId == 0)
|
||||
// {
|
||||
// if (listOptions.Mini)
|
||||
// {
|
||||
// routeValues = new { DataListKey = DataListKey, Mini = listOptions.Mini };
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// routeValues = new { DataListKey = DataListKey };
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (listOptions.Mini)
|
||||
// {
|
||||
// routeValues = new { DataListKey = DataListKey, DataFilterId = listOptions.DataFilterId, Mini = listOptions.Mini };
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// routeValues = new { DataListKey = DataListKey, DataFilterId = listOptions.DataFilterId };
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// var pageLinks = new PaginationLinkBuilder(Url, routeName, routeValues, listOptions, totalRecordCount).PagingLinksObject();
|
||||
|
||||
//BUILD THE COLUMNS RETURN PROPERTY JSON FRAGMENT
|
||||
Newtonsoft.Json.Linq.JArray ColumnsJSON = null;
|
||||
if (listOptions.Mini)
|
||||
if (listOptions.Mini != null && listOptions.Mini == true)
|
||||
{
|
||||
ColumnsJSON = DataList.GenerateMINIListColumnsJSON();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
|
||||
//Build the SELECT portion of a list query based on the template, mini or full and the object key in question
|
||||
internal static string Build(List<AyaDataListFieldDefinition> objectFieldsList, string template, bool mini)
|
||||
internal static string Build(List<AyaDataListFieldDefinition> objectFieldsList, string template, bool? mini)
|
||||
{
|
||||
|
||||
//parse the template
|
||||
@@ -22,7 +22,7 @@ namespace AyaNova.DataList
|
||||
|
||||
//convert to strings array (https://stackoverflow.com/a/33836599/8939)
|
||||
string[] templateFieldList;
|
||||
if (mini)
|
||||
if (mini!=null && mini==true)
|
||||
{
|
||||
templateFieldList = ((JArray)jtemplate["mini"]).ToObject<string[]>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user