@simitgroup/simpleapp-generator 1.6.7-l-alpha → 1.6.7-m-alpha

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/ReleaseNote.md CHANGED
@@ -1,3 +1,6 @@
1
+ [1.6.7m-alpha]
2
+ 1. insert many bug fix
3
+
1
4
  [1.6.7l-alpha]
2
5
  1. insert many support transaction
3
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "1.6.7l-alpha",
3
+ "version": "1.6.7m-alpha",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -337,12 +337,9 @@ export class SimpleAppService<T extends { _id?: string; __v?: number }> {
337
337
  }
338
338
 
339
339
  async createManyWithId(appuser: UserContext, datas: T[]) {
340
- if (Array.isArray(datas)) {
341
- const dbsession = appuser.getDBSession();
342
- if (dbsession && !dbsession.inTransaction()) {
343
- dbsession.startTransaction({ readPreference: 'primary' });
344
- }
345
340
 
341
+ if (Array.isArray(datas)) {
342
+
346
343
  for (let i = 0; i < datas.length; i++) {
347
344
  const data = datas[i];
348
345
  let isolationFilter: any = { ...appuser.getCreateFilterWithId() };
@@ -353,12 +350,11 @@ export class SimpleAppService<T extends { _id?: string; __v?: number }> {
353
350
  await this.validateData(appuser, data);
354
351
  this.applyNestedDateTime(appuser, data, 'create');
355
352
  }
356
-
353
+
357
354
  const dbsession = appuser.getDBSession();
358
355
  if (dbsession && !dbsession.inTransaction()) {
359
356
  dbsession.startTransaction({ readPreference: 'primary' });
360
357
  }
361
- const result = await this.doc.insertMany(datas,{session:dbsession});
362
358
 
363
359
  const result = await this.doc.insertMany(datas, { session: dbsession });
364
360
  await this.audittrail.addManyEvents(appuser, this.documentName, 'createMany', datas);