Skip to content

Commit

Permalink
AG-1328: improvement per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hallieswan committed May 14, 2024
1 parent 9c90151 commit a5157c3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export class GeneNominatedTargetsComponent implements OnInit {
// First map all entries nested in the data to a new array
if (de.target_nominations?.length) {
teamsArray = de.target_nominations.map((nt: TargetNomination) => nt.team);
studyArray = de.target_nominations
.map((nt: TargetNomination) => nt.study)
.filter((item) => Boolean(item)) as string[];
studyArray = this.removeNullAndEmptyStrings(
de.target_nominations.map((nt: TargetNomination) => nt.study)
);
programsArray = de.target_nominations.map(
(nt: TargetNomination) => nt.source
);
Expand Down Expand Up @@ -162,6 +162,10 @@ export class GeneNominatedTargetsComponent implements OnInit {
});
}

removeNullAndEmptyStrings(items: (string | null)[]) {
return items.filter((item) => Boolean(item)) as string[];
}

getUnique(value: string, index: number, self: any) {
return self.indexOf(value) === index;
}
Expand Down

0 comments on commit a5157c3

Please sign in to comment.