@tachybase/actions 1.3.11 → 1.3.12
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/lib/actions/list.js +4 -4
- package/package.json +5 -5
package/lib/actions/list.js
CHANGED
|
@@ -131,25 +131,25 @@ async function listWithPagination(ctx) {
|
|
|
131
131
|
const query = `
|
|
132
132
|
WITH RECURSIVE tree1 AS (
|
|
133
133
|
SELECT id, ${foreignKey}
|
|
134
|
-
FROM ${collection.
|
|
134
|
+
FROM ${collection.model.getTableName()}
|
|
135
135
|
WHERE id = :dataId
|
|
136
136
|
|
|
137
137
|
UNION ALL
|
|
138
138
|
|
|
139
139
|
SELECT p.id, p.${foreignKey}
|
|
140
140
|
FROM tree1 up
|
|
141
|
-
JOIN ${collection.
|
|
141
|
+
JOIN ${collection.model.getTableName()} p ON up.${foreignKey} = p.id
|
|
142
142
|
),
|
|
143
143
|
tree2 AS (
|
|
144
144
|
SELECT id, ${foreignKey}
|
|
145
|
-
FROM ${collection.
|
|
145
|
+
FROM ${collection.model.getTableName()}
|
|
146
146
|
WHERE id = :dataId
|
|
147
147
|
|
|
148
148
|
UNION ALL
|
|
149
149
|
|
|
150
150
|
SELECT p.id, p.${foreignKey}
|
|
151
151
|
FROM tree2 down
|
|
152
|
-
JOIN ${collection.
|
|
152
|
+
JOIN ${collection.model.getTableName()} p ON down.id = p.${foreignKey}
|
|
153
153
|
)
|
|
154
154
|
SELECT DISTINCT *
|
|
155
155
|
FROM (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/actions",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"koa": "^2.15.3",
|
|
10
10
|
"lodash": "4.17.21",
|
|
11
11
|
"sequelize": "^6.37.5",
|
|
12
|
-
"@tachybase/cache": "1.3.
|
|
13
|
-
"@tachybase/
|
|
14
|
-
"@tachybase/
|
|
15
|
-
"@tachybase/
|
|
12
|
+
"@tachybase/cache": "1.3.12",
|
|
13
|
+
"@tachybase/database": "1.3.12",
|
|
14
|
+
"@tachybase/resourcer": "1.3.12",
|
|
15
|
+
"@tachybase/utils": "1.3.12"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/koa": "^2.15.0",
|