rez_core 5.0.256 → 5.0.258
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/meta/repository/entity-attribute-update.repository.d.ts +1 -1
- package/dist/module/meta/repository/entity-attribute-update.repository.js +4 -3
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -1
- package/dist/module/meta/service/entity-attribute-update.service.js +1 -1
- package/dist/module/meta/service/entity-attribute-update.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/meta/repository/entity-attribute-update.repository.ts +10 -11
- package/src/module/meta/service/entity-attribute-update.service.ts +1 -1
package/package.json
CHANGED
|
@@ -4,21 +4,22 @@ import { ReflectionHelper } from '../../../utils/service/reflection-helper.servi
|
|
|
4
4
|
|
|
5
5
|
@Injectable()
|
|
6
6
|
export class EntityUpdateRepository {
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly entityManager: EntityManager,
|
|
9
|
+
private readonly reflectionHelper: ReflectionHelper,
|
|
10
|
+
) {}
|
|
12
11
|
|
|
13
|
-
async updateEntityAttribute(entity, config) {
|
|
14
|
-
const {
|
|
12
|
+
async updateEntityAttribute(entity, config, user) {
|
|
13
|
+
const { entity_type } = entity;
|
|
14
|
+
const { organization_id } = user;
|
|
15
15
|
|
|
16
16
|
// 1. Get the table name
|
|
17
|
-
const entityMasterRepo =
|
|
17
|
+
const entityMasterRepo =
|
|
18
|
+
this.reflectionHelper.getRepoService('EntityMaster');
|
|
18
19
|
|
|
19
20
|
const result = await entityMasterRepo.findOne({
|
|
20
21
|
where: {
|
|
21
|
-
mapped_entity_type:
|
|
22
|
+
mapped_entity_type: entity_type,
|
|
22
23
|
organization_id,
|
|
23
24
|
},
|
|
24
25
|
});
|
|
@@ -42,7 +43,5 @@ export class EntityUpdateRepository {
|
|
|
42
43
|
.set({ [config.attribute_key]: config.attribute_value })
|
|
43
44
|
.where(`${idColumn} = :id`, { id: entity.id })
|
|
44
45
|
.execute();
|
|
45
|
-
|
|
46
46
|
}
|
|
47
|
-
|
|
48
47
|
}
|