Add accessor method to retrieve array filter value from EntityTypeFilter

Co-authored-by: Tim Hansen <timbonicus@gmail.com>
Co-authored-by: Chase Rutherford-Jenkins <chaseajen@users.noreply.github.com>
Co-authored-by: Himanshu Mishra <himanshum@spotify.com>
Co-authored-by: Joe Porpeglia <josephp@spotify.com>
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-06-28 18:24:24 +01:00
parent 8631f422d4
commit 7f3f5c9b91
+6 -2
View File
@@ -32,10 +32,14 @@ export class EntityKindFilter implements EntityFilter {
}
export class EntityTypeFilter implements EntityFilter {
constructor(readonly value: string) {}
constructor(readonly value: string | string[]) {}
getTypes() {
return Array.isArray(this.value) ? this.value : [this.value];
}
getCatalogFilters(): Record<string, string | string[]> {
return { 'spec.type': this.value };
return { 'spec.type': this.getTypes() };
}
}