@nextage/nx-frame-be 1.0.7 → 1.0.10

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.
@@ -30,8 +30,10 @@ import { ArrayItemParams, BaseMongoDoc } from './base.interfaces';
30
30
  import { FilterParams, QueryPagination } from './base.interfaces';
31
31
  export declare abstract class BaseController<TAttrs, TDoc extends BaseMongoDoc, T extends BaseModel<TAttrs, TDoc, any>> {
32
32
  model: T;
33
- constructor({ model }: {
33
+ mergeUpdate: boolean;
34
+ constructor({ model, mergeUpdate }: {
34
35
  model: T;
36
+ mergeUpdate?: boolean;
35
37
  });
36
38
  get collectionName(): string | null;
37
39
  /**
@@ -11,8 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BaseController = void 0;
13
13
  class BaseController {
14
- constructor({ model }) {
14
+ constructor({ model, mergeUpdate }) {
15
+ this.mergeUpdate = false;
15
16
  this.model = model;
17
+ this.mergeUpdate = !!mergeUpdate;
16
18
  }
17
19
  get collectionName() {
18
20
  return this.model.collectionName;
@@ -85,7 +87,7 @@ class BaseController {
85
87
  */
86
88
  update(id, item, context) {
87
89
  this.parseItem(item, context);
88
- return this.model.update(id, item, context);
90
+ return this.model.update(id, item, this.mergeUpdate, context);
89
91
  }
90
92
  /**
91
93
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextage/nx-frame-be",
3
- "version": "1.0.7",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",