Merge branch 'master' into chore/aws-v2-to-v3

This commit is contained in:
Michael Drury 2025-01-07 17:48:11 +00:00 committed by GitHub
commit c27f7daaee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.2.33",
"version": "3.2.34",
"npmClient": "yarn",
"concurrency": 20,
"command": {

View File

@ -66,10 +66,9 @@ export const patchAPI = API => {
}
}
const fetchRelationshipData = API.fetchRelationshipData
API.fetchRelationshipData = async params => {
const tableId = params?.tableId
const rows = await fetchRelationshipData(params)
return await enrichRows(rows, tableId)
API.fetchRelationshipData = async (sourceId, rowId, fieldName) => {
const rows = await fetchRelationshipData(sourceId, rowId, fieldName)
return await enrichRows(rows, sourceId)
}
const fetchTableData = API.fetchTableData
API.fetchTableData = async tableId => {
@ -85,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)
}

View File

@ -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: [] }
}
}