This commit is contained in:
@@ -3331,11 +3331,11 @@ RELATIVE TOKEN EXAMPLE:
|
||||
|
||||
|
||||
//CREATE FILTER
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify("Test BOOL DataFilter");
|
||||
// dynamic d = new JObject();
|
||||
// d.name = Util.Uniquify("Test BOOL DataFilter");
|
||||
|
||||
d["public"] = true;
|
||||
d.listKey = "TestWidgetDataList";
|
||||
// d["public"] = true;
|
||||
// d.listKey = "TestWidgetDataList";
|
||||
|
||||
dynamic dfilter = new JArray();
|
||||
|
||||
@@ -3355,16 +3355,14 @@ RELATIVE TOKEN EXAMPLE:
|
||||
|
||||
d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
||||
|
||||
a = await Util.PostAsync("DataListFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
// a = await Util.PostAsync("DataListFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
// long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
//was before refactor to single list
|
||||
// a = await Util.GetAsync($"Widget/listwidgets?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
//http://localhost:7575/api/v8/DataList/List?DataListKey=TestWidgetDataList
|
||||
a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
//a = await Util.GetAsync($"DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.PostAsync($"DataList", await Util.GetTokenAsync("manager", "l3tm3in"),Util.BuildDataListRequest(dfilter));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -3401,9 +3399,9 @@ RELATIVE TOKEN EXAMPLE:
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
//DELETE DATAFILTER
|
||||
a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
// //DELETE DATAFILTER
|
||||
// a = await Util.DeleteAsync("DataListFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
// Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
}
|
||||
|
||||
|
||||
28
util.cs
28
util.cs
@@ -29,7 +29,7 @@ namespace raven_integration
|
||||
{
|
||||
//#######################################################################################################
|
||||
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
|
||||
// public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
// public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
//#######################################################################################################
|
||||
@@ -586,5 +586,31 @@ namespace raven_integration
|
||||
return dCustomField.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static string BuildDataListRequest(dynamic dFilter, dynamic dSort=null, int limit = 999, int offset = 0, bool mini = false, string dataListKey = "TestWidgetDataList")
|
||||
{
|
||||
/*
|
||||
{
|
||||
"offset": 0,
|
||||
"limit": 5,
|
||||
"mini": false,
|
||||
"dataListKey": "TestWidgetDataList",
|
||||
"filterJson": "",
|
||||
"sortJson": ""
|
||||
}
|
||||
*/
|
||||
dynamic d = new JObject();
|
||||
d.offset = offset;
|
||||
d.limit = limit;
|
||||
d.mini = mini;
|
||||
d.dataListKey = dataListKey;
|
||||
d.filterJson = dFilter.ToString();
|
||||
if (dSort != null)
|
||||
d.sortJson = dSort.ToString();
|
||||
return d.ToString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
|
||||
Reference in New Issue
Block a user