allow calculation views to be used in context components again

This commit is contained in:
Martin McKeaveney 2020-10-16 15:26:08 +01:00
parent fff78a0072
commit bd2fec7594
1 changed files with 8 additions and 3 deletions

View File

@ -46,13 +46,18 @@ export default async function fetchData(datasource, store) {
} }
async function fetchViewData() { async function fetchViewData() {
const { field, groupBy } = datasource const { field, groupBy, calculation } = datasource
const params = new URLSearchParams() const params = new URLSearchParams()
if (field) { if (calculation) {
params.set("field", field) params.set("field", field)
params.set("stats", true) params.set("calculation", calculation)
} }
if (groupBy) {
params.set("group", groupBy)
}
if (groupBy) params.set("group", groupBy) if (groupBy) params.set("group", groupBy)
let QUERY_VIEW_URL = field let QUERY_VIEW_URL = field