Skip to content

Commit ed43ae2

Browse files
committed
chore: added getLabels method
Signed-off-by: Maximillian Arruda <[email protected]>
1 parent 3f55714 commit ed43ae2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

front-end/src/app/model/vaga.model.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,16 @@ export class Vaga {
66
labels: { name: string }[];
77
username: string;
88
password: string;
9-
}
9+
10+
private static labelsToHiding: string[] = ["job opportunity"];
11+
12+
public static getLabels(labels: { name: string }[] = []): string {
13+
if (!labels) return "";
14+
let labelMap = labels
15+
.map((a) => a.name)
16+
.filter((a) => Vaga.labelsToHiding.indexOf(a.toLowerCase()) == -1);
17+
if (labelMap.length > 0) {
18+
return labelMap.reduce((a, b) => a + ", " + b);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)