@nocobase/plugin-field-sort 2.1.0-beta.11 → 2.1.0-beta.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.
@@ -10,13 +10,13 @@
10
10
  module.exports = {
11
11
  "antd": "5.24.2",
12
12
  "react": "18.2.0",
13
- "@nocobase/flow-engine": "2.1.0-beta.11",
14
- "@nocobase/client": "2.1.0-beta.11",
13
+ "@nocobase/flow-engine": "2.1.0-beta.12",
14
+ "@nocobase/client": "2.1.0-beta.12",
15
15
  "lodash": "4.17.21",
16
- "@nocobase/database": "2.1.0-beta.11",
17
- "@nocobase/actions": "2.1.0-beta.11",
18
- "@nocobase/server": "2.1.0-beta.11",
19
- "@nocobase/data-source-manager": "2.1.0-beta.11",
16
+ "@nocobase/database": "2.1.0-beta.12",
17
+ "@nocobase/actions": "2.1.0-beta.12",
18
+ "@nocobase/server": "2.1.0-beta.12",
19
+ "@nocobase/data-source-manager": "2.1.0-beta.12",
20
20
  "sequelize": "6.35.2",
21
- "@nocobase/lock-manager": "2.1.0-beta.11"
21
+ "@nocobase/lock-manager": "2.1.0-beta.12"
22
22
  };
@@ -168,7 +168,11 @@ class SortField extends import_database.Field {
168
168
  };
169
169
  const scopeKey = this.options.scopeKey;
170
170
  if (scopeKey) {
171
- const scopeKeyColumn = this.collection.model.rawAttributes[scopeKey].field;
171
+ const scopeKeyAttribute = this.collection.model.rawAttributes[scopeKey];
172
+ if (!scopeKeyAttribute || !scopeKeyAttribute.field) {
173
+ return;
174
+ }
175
+ const scopeKeyColumn = scopeKeyAttribute.field;
172
176
  const groups = await this.collection.model.findAll({
173
177
  attributes: [[import_sequelize.Sequelize.fn("DISTINCT", import_sequelize.Sequelize.col(scopeKeyColumn)), scopeKey]],
174
178
  raw: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-field-sort",
3
- "version": "2.1.0-beta.11",
3
+ "version": "2.1.0-beta.12",
4
4
  "license": "Apache-2.0",
5
5
  "displayName": "Collection field: Sort",
6
6
  "displayName.ru-RU": "Поле коллекции: Сортировка",
@@ -22,5 +22,5 @@
22
22
  "keywords": [
23
23
  "Collection fields"
24
24
  ],
25
- "gitHead": "b02e78b928f476d848b88bc545d3acddca00fe3c"
25
+ "gitHead": "25cee9643f42f850afc4adc33c55a56850ac730d"
26
26
  }