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/dist/module/entity_json/service/entityJson.repository.d.ts +7 -0
- package/dist/module/entity_json/service/entityJson.repository.js +34 -0
- package/dist/module/entity_json/service/entityJson.repository.js.map +1 -0
- package/dist/module/entity_json/service/entity_json.service.d.ts +3 -1
- package/dist/module/entity_json/service/entity_json.service.js +12 -5
- package/dist/module/entity_json/service/entity_json.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/entity_json/service/entityJson.repository.ts +16 -0
- package/src/module/entity_json/service/entity_json.service.ts +10 -6
package/package.json
CHANGED
|
@@ -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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
}
|