c2-mongoose 2.1.193 → 2.1.194

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.
@@ -111,6 +111,9 @@ var C2Flow = /** @class */ (function () {
111
111
  }
112
112
  return [2 /*return*/, dataAfter._doc];
113
113
  }
114
+ if ((0, Utils_1.isEmpty)(dataAfter)) {
115
+ return [2 /*return*/, dataAfter];
116
+ }
114
117
  log = BuildLogFlowItem_1.default.build(options, __assign({ _id: _id }, data), Logger_1.TypeOfOperation.UPDATE, this.repository);
115
118
  return [4 /*yield*/, global.LoggerRepository.create([log], { session: options.session })];
116
119
  case 2:
@@ -137,6 +140,9 @@ var C2Flow = /** @class */ (function () {
137
140
  }
138
141
  return [2 /*return*/, dataAfter._doc];
139
142
  }
143
+ if ((0, Utils_1.isEmpty)(dataAfter)) {
144
+ return [2 /*return*/, dataAfter];
145
+ }
140
146
  log = BuildLogFlowItem_1.default.build(options, __assign({ _id: dataAfter._id }, data), Logger_1.TypeOfOperation.UPDATE, this.repository);
141
147
  return [4 /*yield*/, global.LoggerRepository.create([log], { session: options.session })];
142
148
  case 2:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.193",
3
+ "version": "2.1.194",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,6 +49,9 @@ class C2Flow<D> {
49
49
  }
50
50
  return dataAfter._doc
51
51
  }
52
+ if (isEmpty(dataAfter)) {
53
+ return dataAfter
54
+ }
52
55
 
53
56
  let log: Partial<ILogger> = BuildLogFlowItem.build(options, { _id, ...data }, TypeOfOperation.UPDATE, this.repository)
54
57
  await (global as any).LoggerRepository.create([log], { session: options.session })
@@ -68,6 +71,10 @@ class C2Flow<D> {
68
71
  return dataAfter._doc
69
72
  }
70
73
 
74
+ if (isEmpty(dataAfter)) {
75
+ return dataAfter
76
+ }
77
+
71
78
  let log: Partial<ILogger> = BuildLogFlowItem.build(options, { _id: dataAfter._id, ...data }, TypeOfOperation.UPDATE, this.repository)
72
79
  await (global as any).LoggerRepository.create([log], { session: options.session })
73
80
  if (isEmpty(dataAfter)) {