@nocobase/plugin-collection-sql 1.6.0-alpha.5 → 1.6.0-alpha.6
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/dist/externalVersion.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0-alpha.
|
|
12
|
-
"@nocobase/server": "1.6.0-alpha.
|
|
13
|
-
"@nocobase/database": "1.6.0-alpha.
|
|
14
|
-
"@nocobase/actions": "1.6.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.6.0-alpha.6",
|
|
12
|
+
"@nocobase/server": "1.6.0-alpha.6",
|
|
13
|
+
"@nocobase/database": "1.6.0-alpha.6",
|
|
14
|
+
"@nocobase/actions": "1.6.0-alpha.6",
|
|
15
15
|
"sequelize": "6.35.2",
|
|
16
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
16
|
+
"@nocobase/utils": "1.6.0-alpha.6"
|
|
17
17
|
};
|
|
@@ -31,6 +31,7 @@ __export(sql_exports, {
|
|
|
31
31
|
module.exports = __toCommonJS(sql_exports);
|
|
32
32
|
var import_sql_collection = require("../sql-collection");
|
|
33
33
|
const updateCollection = async (ctx, transaction) => {
|
|
34
|
+
var _a;
|
|
34
35
|
const { filterByTk, values } = ctx.action.params;
|
|
35
36
|
const repo = ctx.db.getRepository("collections");
|
|
36
37
|
const collection = await repo.findOne({
|
|
@@ -41,15 +42,21 @@ const updateCollection = async (ctx, transaction) => {
|
|
|
41
42
|
});
|
|
42
43
|
const existFields = await collection.getFields({ transaction });
|
|
43
44
|
const deletedFields = existFields.filter((field) => {
|
|
44
|
-
var
|
|
45
|
-
return !((
|
|
45
|
+
var _a2;
|
|
46
|
+
return !((_a2 = values.fields) == null ? void 0 : _a2.find((f) => f.name === field.name));
|
|
46
47
|
});
|
|
47
48
|
for (const field of deletedFields) {
|
|
48
49
|
await field.destroy({ transaction });
|
|
49
50
|
}
|
|
50
51
|
const upRes = await repo.update({
|
|
51
52
|
filterByTk,
|
|
52
|
-
values
|
|
53
|
+
values: {
|
|
54
|
+
...values,
|
|
55
|
+
fields: (_a = values.fields) == null ? void 0 : _a.map((f) => {
|
|
56
|
+
delete f.key;
|
|
57
|
+
return f;
|
|
58
|
+
})
|
|
59
|
+
},
|
|
53
60
|
updateAssociationValues: ["fields"],
|
|
54
61
|
transaction
|
|
55
62
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据表: SQL",
|
|
5
5
|
"description": "Provides SQL collection template",
|
|
6
6
|
"description.zh-CN": "提供 SQL 数据表模板",
|
|
7
|
-
"version": "1.6.0-alpha.
|
|
7
|
+
"version": "1.6.0-alpha.6",
|
|
8
8
|
"homepage": "https://docs-cn.nocobase.com/handbook/collection-sql",
|
|
9
9
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/collection-sql",
|
|
10
10
|
"main": "dist/server/index.js",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"keywords": [
|
|
18
18
|
"Collections"
|
|
19
19
|
],
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "485580ad30e5164ead7e15f3b4d219f2bce2caf4"
|
|
21
21
|
}
|