@nocobase/actions 1.3.38-beta → 1.4.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.
@@ -74,8 +74,8 @@ const _SortAbleCollection = class _SortAbleCollection {
74
74
  }
75
75
  // insert source position to target position
76
76
  async move(sourceInstanceId, targetInstanceId, options = {}) {
77
- const sourceInstance = await this.collection.repository.findById(sourceInstanceId);
78
- const targetInstance = await this.collection.repository.findById(targetInstanceId);
77
+ const sourceInstance = await this.collection.repository.findByTargetKey(sourceInstanceId);
78
+ const targetInstance = await this.collection.repository.findByTargetKey(targetInstanceId);
79
79
  if (this.scopeKey && sourceInstance.get(this.scopeKey) !== targetInstance.get(this.scopeKey)) {
80
80
  await sourceInstance.update({
81
81
  [this.scopeKey]: targetInstance.get(this.scopeKey)
@@ -84,7 +84,7 @@ const _SortAbleCollection = class _SortAbleCollection {
84
84
  await this.sameScopeMove(sourceInstance, targetInstance, options);
85
85
  }
86
86
  async changeScope(sourceInstanceId, targetScope, method) {
87
- const sourceInstance = await this.collection.repository.findById(sourceInstanceId);
87
+ const sourceInstance = await this.collection.repository.findByTargetKey(sourceInstanceId);
88
88
  const targetScopeValue = targetScope[this.scopeKey];
89
89
  if (targetScopeValue && sourceInstance.get(this.scopeKey) !== targetScopeValue) {
90
90
  await sourceInstance.update(
@@ -101,7 +101,7 @@ const _SortAbleCollection = class _SortAbleCollection {
101
101
  }
102
102
  }
103
103
  async sticky(sourceInstanceId) {
104
- const sourceInstance = await this.collection.repository.findById(sourceInstanceId);
104
+ const sourceInstance = await this.collection.repository.findByTargetKey(sourceInstanceId);
105
105
  await sourceInstance.update(
106
106
  {
107
107
  [this.field.get("name")]: 0
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@nocobase/actions",
3
- "version": "1.3.38-beta",
3
+ "version": "1.4.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/cache": "1.3.38-beta",
10
- "@nocobase/database": "1.3.38-beta",
11
- "@nocobase/resourcer": "1.3.38-beta"
9
+ "@nocobase/cache": "1.4.0-alpha",
10
+ "@nocobase/database": "1.4.0-alpha",
11
+ "@nocobase/resourcer": "1.4.0-alpha"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/nocobase/nocobase.git",
16
16
  "directory": "packages/actions"
17
17
  },
18
- "gitHead": "1b9490667c9224cd0b179cbf75e10a581c49b230"
18
+ "gitHead": "f097a2bddec152522b5645bd5d451f4c866d2060"
19
19
  }