From cb5cce2ea3e91e9b30f1004b666d4c97451278b3 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 31 Jul 2022 21:09:58 +0200 Subject: [PATCH] custom joins working on the same DB --- packages/datalib/src/PerspectiveTreeNode.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/datalib/src/PerspectiveTreeNode.ts b/packages/datalib/src/PerspectiveTreeNode.ts index b5971fa9f..70e9ca0b5 100644 --- a/packages/datalib/src/PerspectiveTreeNode.ts +++ b/packages/datalib/src/PerspectiveTreeNode.ts @@ -551,18 +551,20 @@ export class PerspectiveCustomJoinTreeNode extends PerspectiveTableNode { } getChildMatchColumns() { - return this.customJoin.columns.map(x => x.refColumnName); - } - - getParentMatchColumns() { return this.customJoin.columns.map(x => x.baseColumnName); } + getParentMatchColumns() { + return this.customJoin.columns.map(x => x.refColumnName); + } + getNodeLoadProps(parentRows: any[]): PerspectiveDataLoadProps { + // console.log('CUSTOM JOIN', this.customJoin); + // console.log('this.getDataLoadColumns()', this.getDataLoadColumns()); return { schemaName: this.table.schemaName, pureName: this.table.pureName, - bindingColumns: this.getChildMatchColumns(), + bindingColumns: this.getParentMatchColumns(), bindingValues: _uniqBy( parentRows.map(row => this.customJoin.columns.map(x => row[x.baseColumnName])), stableStringify