rez_core 5.0.237 → 5.0.238
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/.idea/250218_ether_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/workflow/service/entity-modification.service.d.ts +4 -1
- package/dist/module/workflow/service/entity-modification.service.js +8 -4
- package/dist/module/workflow/service/entity-modification.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/service/entity-modification.service.ts +13 -5
package/package.json
CHANGED
|
@@ -7,12 +7,17 @@ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.s
|
|
|
7
7
|
import { UserData } from 'src/module/user/entity/user.entity';
|
|
8
8
|
import { DataSource, EntityManager } from 'typeorm';
|
|
9
9
|
import { EntityMasterService } from '../../meta/service/entity-master.service';
|
|
10
|
+
import { ConfigService } from '@nestjs/config';
|
|
10
11
|
|
|
11
12
|
@Injectable()
|
|
12
13
|
export class EntityModificationService extends EntityServiceImpl {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
schema: String;
|
|
15
|
+
constructor(
|
|
16
|
+
private readonly entityManager: EntityManager,
|
|
17
|
+
private readonly configService: ConfigService,
|
|
18
|
+
) {
|
|
15
19
|
super();
|
|
20
|
+
this.schema = this.configService.get('DB_SCHEMA') || 'default';
|
|
16
21
|
}
|
|
17
22
|
async logModification(modificationData: any, loggedInUser: UserData) {
|
|
18
23
|
const { mapped_entity_type, mapped_entity_id, attribute_key } =
|
|
@@ -25,7 +30,10 @@ export class EntityModificationService extends EntityServiceImpl {
|
|
|
25
30
|
);
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
const entityMeta = await this.entityMasterService.getEntityData(
|
|
33
|
+
const entityMeta = await this.entityMasterService.getEntityData(
|
|
34
|
+
mapped_entity_type,
|
|
35
|
+
loggedInUser,
|
|
36
|
+
);
|
|
29
37
|
|
|
30
38
|
if (!entityMeta || !entityMeta.db_table_name) {
|
|
31
39
|
throw new NotFoundException(
|
|
@@ -38,14 +46,14 @@ export class EntityModificationService extends EntityServiceImpl {
|
|
|
38
46
|
// Step 2: Get the row from the target table using mapped_entity_id
|
|
39
47
|
const [entityRow] = await this.entityManager.query(
|
|
40
48
|
`
|
|
41
|
-
SELECT * FROM ${tableName} WHERE id = $1
|
|
49
|
+
SELECT * FROM ${this.schema}.${tableName} WHERE id = $1
|
|
42
50
|
`,
|
|
43
51
|
[mapped_entity_id],
|
|
44
52
|
);
|
|
45
53
|
|
|
46
54
|
if (!entityRow) {
|
|
47
55
|
throw new NotFoundException(
|
|
48
|
-
`No record found in ${tableName} with ID ${mapped_entity_id}`,
|
|
56
|
+
`No record found in ${this.schema}.${tableName} with ID ${mapped_entity_id}`,
|
|
49
57
|
);
|
|
50
58
|
}
|
|
51
59
|
|