@clairejs/server 3.28.11 → 3.28.13

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.
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## Change Log
2
2
 
3
+ #### 3.28.13
4
+
5
+ - fix update records handle undefined result
6
+
7
+ #### 3.28.12
8
+
9
+ - fix CrudHttpController deleteMany does not return correct fields
10
+
3
11
  #### 3.28.11
4
12
 
5
13
  - fix LocalJobScheduler publish & subscribe issue
@@ -190,10 +190,13 @@ export class CrudHttpController extends AbstractHttpController {
190
190
  body: { update: omitData(record, ["id"]) },
191
191
  tx,
192
192
  });
193
- updatedRecords.push(result);
193
+ const re = result.modified[0];
194
+ if (re) {
195
+ updatedRecords.push(re);
196
+ }
194
197
  }
195
198
  const response = {
196
- modified: updatedRecords.map((re) => re.modified[0]),
199
+ modified: updatedRecords,
197
200
  };
198
201
  return ResponseBuilder.json(response).get();
199
202
  }
@@ -229,9 +232,7 @@ export class CrudHttpController extends AbstractHttpController {
229
232
  async deleteMany(req) {
230
233
  const tx = await this.getCurrentTransaction();
231
234
  const result = await this.crudRepository.deleteMany({ queries: req.getQuery(), tx });
232
- return ResponseBuilder.json({
233
- modified: result.modified.map((instance) => instance.id).map((id) => ({ id })),
234
- }).get();
235
+ return ResponseBuilder.json(result).get();
235
236
  }
236
237
  }
237
238
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/server",
3
- "version": "3.28.11",
3
+ "version": "3.28.13",
4
4
  "description": "Claire server NodeJs framework written in Typescript.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",