Skip to content

Commit

Permalink
Merge branch 'master' into chore/negated-join-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
adrinr authored Oct 17, 2024
2 parents b6874f5 + a5e0a71 commit 0f43c8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.33.0",
"version": "2.33.1",
"npmClient": "yarn",
"packages": [
"packages/*",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/api/controllers/row/ExternalRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ export class ExternalRequest<T extends Operation> {
if (!opts.datasource) {
if (sdk.views.isView(source)) {
const table = await sdk.views.getTable(source.id)
opts.datasource = await sdk.datasources.get(table.sourceId!)
opts.datasource = await sdk.datasources.get(table.sourceId)
} else {
opts.datasource = await sdk.datasources.get(source.sourceId!)
opts.datasource = await sdk.datasources.get(source.sourceId)
}
}

Expand Down
6 changes: 5 additions & 1 deletion packages/server/src/sdk/app/tables/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export async function getExternalTable(
if (!entities[tableName]) {
throw new Error(`Unable to find table named "${tableName}"`)
}
return processTable(entities[tableName])
const table = await processTable(entities[tableName])
if (!table.sourceId) {
table.sourceId = datasourceId
}
return table
}

export async function getTable(tableId: string): Promise<Table> {
Expand Down

0 comments on commit 0f43c8f

Please sign in to comment.