@teamkeel/functions-runtime 0.252.0 → 0.253.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/applyJoins.js +3 -3
package/package.json
CHANGED
package/src/applyJoins.js
CHANGED
|
@@ -12,7 +12,7 @@ function applyJoins(context, qb, where) {
|
|
|
12
12
|
return qb;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const srcTable = context.tableAlias();
|
|
16
16
|
|
|
17
17
|
for (const key of Object.keys(where)) {
|
|
18
18
|
const rel = conf[key];
|
|
@@ -33,7 +33,7 @@ function applyJoins(context, qb, where) {
|
|
|
33
33
|
// and the foreign key is on the target table
|
|
34
34
|
qb = qb.innerJoin(
|
|
35
35
|
`${targetTable} as ${context.tableAlias()}`,
|
|
36
|
-
`${
|
|
36
|
+
`${srcTable}.id`,
|
|
37
37
|
`${context.tableAlias()}.${rel.foreignKey}`
|
|
38
38
|
);
|
|
39
39
|
break;
|
|
@@ -43,7 +43,7 @@ function applyJoins(context, qb, where) {
|
|
|
43
43
|
// and the foreign key is on the source table
|
|
44
44
|
qb = qb.innerJoin(
|
|
45
45
|
`${targetTable} as ${context.tableAlias()}`,
|
|
46
|
-
`${
|
|
46
|
+
`${srcTable}.${rel.foreignKey}`,
|
|
47
47
|
`${context.tableAlias()}.id`
|
|
48
48
|
);
|
|
49
49
|
break;
|