Skip to content

Commit 53a7d78

Browse files
committed
Refactor mixed-value type to include symbol keys
1 parent 6907656 commit 53a7d78

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/_common/types/mixed-value.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export type MixedValue =
1010
| object
1111
| Array<MixedValue>
1212
| {
13-
[key: string | number]: MixedValue;
13+
[key: string | number | symbol]: MixedValue;
1414
};

src/management/identities/identities.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,15 @@ export class IdentitiesService extends AbstractServiceSchema {
441441
//fusionne les deux identités id2 > id1 les champs presents dans id2 et non present dans id1 seront ajoutés
442442
// retourne l'id de na nouvelle identité créée
443443
public async fusion(id1, id2) {
444-
let identity1 = null;
445-
let identity2 = null;
444+
let identity1: Identities = null;
445+
let identity2: Identities = null;
446446
try {
447-
identity1 = await this.findById(id1);
447+
identity1 = await this.findById<Identities>(id1);
448448
} catch (error) {
449449
throw new BadRequestException('Id1 not found');
450450
}
451451
try {
452-
identity2 = await this.findById(id2);
452+
identity2 = await this.findById<Identities>(id2);
453453
} catch (error) {
454454
throw new BadRequestException('Id2 not found');
455455
}
@@ -490,7 +490,7 @@ export class IdentitiesService extends AbstractServiceSchema {
490490
}
491491
newObj.state = IdentityState.TO_VALIDATE;
492492
newObj.srcFusionId = [identity1._id, identity2._id];
493-
const newIdentity = await this.create(newObj);
493+
const newIdentity = await this.create(newObj) as Identities;
494494
//MAJ identite1
495495
identity1.destFusionId = newIdentity._id;
496496
identity1.state = IdentityState.DONT_SYNC;

0 commit comments

Comments
 (0)