From d7b1b1a3671f7bab4f80cd825c4a8e98bc6cde03 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 7 Jan 2025 16:52:01 +0100 Subject: [PATCH 1/3] Fix issues when fetching view v1 data --- packages/client/src/api/patches.js | 4 ++-- packages/frontend-core/src/fetch/ViewFetch.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/client/src/api/patches.js b/packages/client/src/api/patches.js index 5413379b72..9203ac3c70 100644 --- a/packages/client/src/api/patches.js +++ b/packages/client/src/api/patches.js @@ -85,9 +85,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) } diff --git a/packages/frontend-core/src/fetch/ViewFetch.js b/packages/frontend-core/src/fetch/ViewFetch.js index 272c222dd4..eb89f9b67a 100644 --- a/packages/frontend-core/src/fetch/ViewFetch.js +++ b/packages/frontend-core/src/fetch/ViewFetch.js @@ -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: [] } } } From 64471bd7337ede6fbc598cd7806728858474b569 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 7 Jan 2025 17:12:56 +0000 Subject: [PATCH 2/3] Fix enrich endpoint in client --- packages/client/src/api/patches.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/src/api/patches.js b/packages/client/src/api/patches.js index 5413379b72..6ea3b7c183 100644 --- a/packages/client/src/api/patches.js +++ b/packages/client/src/api/patches.js @@ -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 => { From 21bfb7a45da8b1b615c100d8d52d0e991e24eae5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 7 Jan 2025 17:47:14 +0000 Subject: [PATCH 3/3] Bump version to 3.2.34 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 3afc2c60e9..bc3f341979 100644 --- a/lerna.json +++ b/lerna.json @@ -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": {