@nocobase/database 1.6.15 → 1.6.17

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.
@@ -80,7 +80,13 @@ const _HasManyRepository = class _HasManyRepository extends import_multiple_rela
80
80
  if (options && options["filter"]) {
81
81
  const filterResult = this.parseFilter(options["filter"], options);
82
82
  if (filterResult.include && filterResult.include.length > 0) {
83
- return await this.destroyByFilter(options["filter"], transaction2);
83
+ return await this.destroyByFilter(
84
+ {
85
+ filter: options["filter"],
86
+ filterByTk: options["filterByTk"]
87
+ },
88
+ transaction2
89
+ );
84
90
  }
85
91
  where.push(filterResult.where);
86
92
  }
@@ -18,7 +18,10 @@ export declare abstract class MultipleRelationRepository extends RelationReposit
18
18
  remove(options: TargetKey | TargetKey[] | AssociatedOptions): Promise<void>;
19
19
  update(options?: UpdateOptions): Promise<any>;
20
20
  destroy(options?: TargetKey | DestroyOptions): Promise<boolean>;
21
- protected destroyByFilter(filter: Filter, transaction?: Transaction): Promise<boolean>;
21
+ protected destroyByFilter(options: {
22
+ filter?: Filter;
23
+ filterByTk?: TargetKey | TargetKey[];
24
+ }, transaction?: Transaction): Promise<boolean>;
22
25
  protected filterHasInclude(filter: Filter, options?: any): boolean;
23
26
  protected accessors(): MultiAssociationAccessors;
24
27
  updateOrCreate(options: FirstOrCreateOptions): Promise<any>;
@@ -174,9 +174,9 @@ const _MultipleRelationRepository = class _MultipleRelationRepository extends im
174
174
  async destroy(options) {
175
175
  return false;
176
176
  }
177
- async destroyByFilter(filter, transaction2) {
177
+ async destroyByFilter(options, transaction2) {
178
178
  const instances = await this.find({
179
- filter,
179
+ ...options,
180
180
  transaction: transaction2
181
181
  });
182
182
  return await this.destroy({
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "1.6.15",
3
+ "version": "1.6.17",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "AGPL-3.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "1.6.15",
10
- "@nocobase/utils": "1.6.15",
9
+ "@nocobase/logger": "1.6.17",
10
+ "@nocobase/utils": "1.6.17",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -38,5 +38,5 @@
38
38
  "url": "git+https://github.com/nocobase/nocobase.git",
39
39
  "directory": "packages/database"
40
40
  },
41
- "gitHead": "4628ae31452340bcb502e6a32e79f3d7f7349222"
41
+ "gitHead": "9067874312fef0d31e8127c8b499f6c37e99846e"
42
42
  }