@nocobase/data-source-manager 1.0.1-alpha.1 → 1.2.0-alpha

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.
@@ -41,11 +41,15 @@ function findArgs(ctx) {
41
41
  const resourceName = ctx.action.resourceName;
42
42
  const params = ctx.action.params;
43
43
  if (params.tree) {
44
- const [collectionName, associationName] = resourceName.split(".");
45
- const collection = ctx.db.getCollection(resourceName);
46
- if (collection.options.tree && !(associationName && collectionName === collection.name)) {
47
- const foreignKey = ((_a = collection.treeParentField) == null ? void 0 : _a.foreignKey) || "parentId";
48
- (0, import_utils.assign)(params, { filter: { [foreignKey]: null } }, { filter: "andMerge" });
44
+ if ((0, import_utils.isValidFilter)(params.filter)) {
45
+ params.tree = false;
46
+ } else {
47
+ const [collectionName, associationName] = resourceName.split(".");
48
+ const collection = ctx.db.getCollection(resourceName);
49
+ if (collection.options.tree && !(associationName && collectionName === collection.name)) {
50
+ const foreignKey = ((_a = collection.treeParentField) == null ? void 0 : _a.foreignKey) || "parentId";
51
+ (0, import_utils.assign)(params, { filter: { [foreignKey]: null } }, { filter: "andMerge" });
52
+ }
49
53
  }
50
54
  }
51
55
  const { tree, fields, filter, appends, except, sort } = params;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@nocobase/data-source-manager",
3
- "version": "1.0.1-alpha.1",
3
+ "version": "1.2.0-alpha",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "dependencies": {
9
- "@nocobase/actions": "1.0.1-alpha.1",
10
- "@nocobase/cache": "1.0.1-alpha.1",
11
- "@nocobase/database": "1.0.1-alpha.1",
12
- "@nocobase/resourcer": "1.0.1-alpha.1",
13
- "@nocobase/utils": "1.0.1-alpha.1",
9
+ "@nocobase/actions": "1.2.0-alpha",
10
+ "@nocobase/cache": "1.2.0-alpha",
11
+ "@nocobase/database": "1.2.0-alpha",
12
+ "@nocobase/resourcer": "1.2.0-alpha",
13
+ "@nocobase/utils": "1.2.0-alpha",
14
14
  "@types/jsonwebtoken": "^8.5.8",
15
15
  "jsonwebtoken": "^8.5.1"
16
16
  },
@@ -19,5 +19,5 @@
19
19
  "url": "git+https://github.com/nocobase/nocobase.git",
20
20
  "directory": "packages/auth"
21
21
  },
22
- "gitHead": "d24aa16987a4068f857ae073fcce18f3cb490660"
22
+ "gitHead": "c7dc1f277ef3722df0ec8d5532bcb66322c0fae2"
23
23
  }