@nocobase/actions 0.12.0-alpha.4 → 0.13.0-alpha.1

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.
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.add = add;
7
- var _utils = require("../utils");
8
7
  function _database() {
9
8
  const data = require("@nocobase/database");
10
9
  _database = function _database() {
@@ -12,6 +11,7 @@ function _database() {
12
11
  };
13
12
  return data;
14
13
  }
14
+ var _utils = require("../utils");
15
15
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
16
16
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
17
17
  function add(_x, _x2) {
@@ -23,7 +23,8 @@ function _add() {
23
23
  if (!(repository instanceof _database().MultipleRelationRepository || repository instanceof _database().HasManyRepository || repository instanceof _database().ArrayFieldRepository)) {
24
24
  return yield next();
25
25
  }
26
- yield repository.add(ctx.action.params.values);
26
+ const filterByTk = ctx.action.params.filterByTk || ctx.action.params.filterByTks || ctx.action.params.values;
27
+ yield repository.add(filterByTk);
27
28
  ctx.status = 200;
28
29
  yield next();
29
30
  });
package/lib/utils.js CHANGED
@@ -27,7 +27,8 @@ function RelationRepositoryActionBuilder(method) {
27
27
  return /*#__PURE__*/function () {
28
28
  var _ref = _asyncToGenerator(function* (ctx, next) {
29
29
  const repository = getRepositoryFromParams(ctx);
30
- yield repository[method](ctx.action.params.values);
30
+ const filterByTk = ctx.action.params.filterByTk || ctx.action.params.filterByTks || ctx.action.params.values;
31
+ yield repository[method](filterByTk);
31
32
  ctx.status = 200;
32
33
  yield next();
33
34
  });
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@nocobase/actions",
3
- "version": "0.12.0-alpha.4",
3
+ "version": "0.13.0-alpha.1",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "dependencies": {
9
- "@nocobase/cache": "0.12.0-alpha.4",
10
- "@nocobase/database": "0.12.0-alpha.4",
11
- "@nocobase/resourcer": "0.12.0-alpha.4"
9
+ "@nocobase/cache": "0.13.0-alpha.1",
10
+ "@nocobase/database": "0.13.0-alpha.1",
11
+ "@nocobase/resourcer": "0.13.0-alpha.1"
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": "215dc3b2437c501ca903b56cc378ab5e81c8a11c"
18
+ "gitHead": "0ebd4e85a1b0b0d0943768ab6cb5c3d824562239"
19
19
  }