Skip to content

Commit

Permalink
simplify copy dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Metauriel committed Sep 19, 2023
1 parent 9afc77b commit 24dd5b9
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@nestjs/common';
import { AuthorizableObject } from '@shared/domain/domain-object';
import { BaseEntity } from '@shared/domain/entity';
import { EntityId } from '@shared/domain/types';
import { CopyDictionary, CopyStatus, CopyStatusEnum } from '../types/copy.types';

Expand Down Expand Up @@ -44,7 +43,7 @@ export class CopyHelperService {
}

buildCopyEntityDict(status: CopyStatus): CopyDictionary {
const map = this.instanciateCopyDictionary();
const map = new Map<EntityId, AuthorizableObject>();
status.elements?.forEach((elementStatus: CopyStatus) => {
this.buildCopyEntityDict(elementStatus).forEach((el, key) => map.set(key, el));
});
Expand All @@ -53,8 +52,4 @@ export class CopyHelperService {
}
return map;
}

private instanciateCopyDictionary(): CopyDictionary {
return new Map<EntityId, BaseEntity | AuthorizableObject>();
}
}

0 comments on commit 24dd5b9

Please sign in to comment.