rez_core 4.0.243 → 4.0.244

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.243",
3
+ "version": "4.0.244",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -0,0 +1,16 @@
1
+ import { Injectable } from "@nestjs/common";
2
+ import { InjectRepository } from "@nestjs/typeorm";
3
+ import { Repository } from "typeorm";
4
+ import { EntityJson } from "../entity/entityJson.entity";
5
+ import { create } from "domain";
6
+
7
+
8
+ @Injectable()
9
+ export class EntityJSONRepository {
10
+ constructor(
11
+ @InjectRepository(EntityJson) private readonly entityJSONRepository: Repository<EntityJson>,
12
+ ) {}
13
+ async create(flatJson: Partial<EntityJson>) {
14
+ return this.entityJSONRepository.save(flatJson);
15
+ }
16
+ }
@@ -6,6 +6,7 @@ import { EntityRelation } from 'src/module/meta/entity/entity-relation.entity';
6
6
  import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
7
7
  import { LoggingService } from 'src/utils/service/loggingUtil.service';
8
8
  import { DataSource } from 'typeorm';
9
+ import { EntityJSONRepository } from './entityJson.repository';
9
10
 
10
11
  @Injectable()
11
12
  export class EntityJSONService extends EntityServiceImpl {
@@ -13,6 +14,7 @@ export class EntityJSONService extends EntityServiceImpl {
13
14
  private readonly dataSource: DataSource,
14
15
  private readonly filterService: FilterService,
15
16
  private readonly loggerService: LoggingService,
17
+ private readonly EntityJSONRepository:EntityJSONRepository
16
18
  ) {
17
19
  super();
18
20
  }
@@ -170,12 +172,14 @@ export class EntityJSONService extends EntityServiceImpl {
170
172
  }
171
173
 
172
174
  await this.loggerService.log('info', 'EntityJSONService', 'updateEntityJSON', `Saving flat JSON for entity: ${entityType}#${entityId}`);
173
- await this.dataSource.query(
174
- `INSERT INTO frm_entity_json (entity_type, entity_id, json_data, created_by)
175
- VALUES (?, ?, ?, ?)
176
- ON DUPLICATE KEY UPDATE json_data = VALUES(json_data), updated_by = VALUES(created_by)`,
177
- [entityType, entityId, JSON.stringify(flatJson), loggedInUser.id],
178
- );
175
+ let JsonData = {
176
+ entity_type: entityType,
177
+ entity_id: entityId,
178
+ json_data: flatJson,
179
+ created_by: loggedInUser.id,
180
+ }
181
+
182
+ await this.EntityJSONRepository.create(JsonData);
179
183
 
180
184
  return flatJson;
181
185
  }