Skip to content

Commit f695f11

Browse files
author
guyplusplus
committed
Ready for better API for fetchData
1 parent 8ac9cdb commit f695f11

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,6 @@ $
208208
- [ ] Add internationalization example
209209
- [ ] Create test script
210210
- [X] Create own plugin icon
211+
- [ ] Improve fetchData (actually Array) with a more reusable and paramerizable API
211212

212213

vis_type_custom_form_filter_accounts/public/fetch_data.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,25 @@ export async function fetchData(core: CoreSetup, indexName, fieldName) {
8080
direction: 'desc',
8181
query,
8282
});
83-
const filters = [];
8483
const create = dataPluginStart.search.searchSource.create;
8584
const searchSource = create(initialSearchSourceState);
8685
searchSource.setParent(undefined);
86+
const filters = [];
87+
/* a filter could be
88+
{
89+
meta: {
90+
controlledBy: "1593926398196",
91+
index: 'acf225f0-b369-11ea-8a24-979c290ba95f',
92+
key: 'balance',
93+
},
94+
"range": {
95+
"balance": {
96+
"gte": 10000,
97+
"lte": 20000,
98+
}
99+
}
100+
}
101+
*/
87102
const useTimeFilter = false;
88103
const timefilter = null;
89104
searchSource.setField('filter', () => {

0 commit comments

Comments
 (0)