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
|
||||
API.fetchViewData = async params => {
|
||||
API.fetchViewData = async (viewName, params) => {
|
||||
const tableId = params?.tableId
|
||||
const rows = await fetchViewData(params)
|
||||
const rows = await fetchViewData(viewName, params)
|
||||
return await enrichRows(rows, tableId)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,15 @@ export default class ViewFetch extends DataFetch {
|
|||
async getData() {
|
||||
const { datasource } = this.options
|
||||
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 || [] }
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return { rows: [] }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue