Merge pull request #15318 from Budibase/fix/view-v1-data
Fix issues when fetching view v1 data
This commit is contained in:
commit
a23304e27f
|
@ -84,9 +84,9 @@ export const patchAPI = API => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const fetchViewData = API.fetchViewData
|
const fetchViewData = API.fetchViewData
|
||||||
API.fetchViewData = async params => {
|
API.fetchViewData = async (viewName, params) => {
|
||||||
const tableId = params?.tableId
|
const tableId = params?.tableId
|
||||||
const rows = await fetchViewData(params)
|
const rows = await fetchViewData(viewName, params)
|
||||||
return await enrichRows(rows, tableId)
|
return await enrichRows(rows, tableId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,15 @@ export default class ViewFetch extends DataFetch {
|
||||||
async getData() {
|
async getData() {
|
||||||
const { datasource } = this.options
|
const { datasource } = this.options
|
||||||
try {
|
try {
|
||||||
const res = await this.API.fetchViewData(datasource.name)
|
const res = await this.API.fetchViewData(datasource.name, {
|
||||||
|
calculation: datasource.calculation,
|
||||||
|
field: datasource.field,
|
||||||
|
groupBy: datasource.groupBy,
|
||||||
|
tableId: datasource.tableId,
|
||||||
|
})
|
||||||
return { rows: res || [] }
|
return { rows: res || [] }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
return { rows: [] }
|
return { rows: [] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue