Skip to content

Commit 41de9c9

Browse files
committed
fix: using Vaga.getLabels method
Signed-off-by: Maximillian Arruda <[email protected]>
1 parent ef27a36 commit 41de9c9

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

front-end/src/app/pages/cadastro-vaga/cadastro-vaga.page.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { VagaService } from "src/app/service/vaga.service";
1+
import { VagaService } from "@service/vaga.service";
22
import { Router, ActivatedRoute } from "@angular/router";
33
import { Component, OnInit } from "@angular/core";
4-
import { Vaga } from "src/app/model/vaga.model";
4+
import { Vaga } from "@model/vaga.model";
55
import { DomSanitizer } from "@angular/platform-browser";
66
import { marked } from "marked";
77
import { AlertController, LoadingController } from "@ionic/angular";
@@ -74,12 +74,7 @@ export class CadastroVagaPage implements OnInit {
7474
}
7575

7676
getLabels(labels) {
77-
if (labels) {
78-
let labelMap = labels.map((a) => a.name);
79-
if (labelMap.length > 0) {
80-
return labelMap.reduce((a) => a + ", ");
81-
}
82-
}
77+
return Vaga.getLabels(labels);
8378
}
8479

8580
private applyDefaultOptions() {

front-end/src/app/pages/vagas/vagas.page.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { Vaga } from "./../../model/vaga.model";
1+
import { Vaga } from "@model/vaga.model";
22
import { Component, OnInit } from "@angular/core";
3-
import { VagaService } from "src/app/service/vaga.service";
3+
import { VagaService } from "@service/vaga.service";
44
import { Router } from "@angular/router";
5-
import { DomSanitizer } from "@angular/platform-browser";
65
import { AlertController, LoadingController } from "@ionic/angular";
76

87
@Component({
@@ -98,11 +97,6 @@ export class VagasPage implements OnInit {
9897
}
9998

10099
getLabels(labels: any[]) {
101-
if (labels) {
102-
let labelMap = labels.map((a) => a.name);
103-
if (labelMap.length > 0) {
104-
return labelMap.reduce((a) => a + ", ");
105-
}
106-
}
100+
return Vaga.getLabels(labels);
107101
}
108102
}

0 commit comments

Comments
 (0)