change ifs to switch-case
This commit is contained in:
@@ -28,23 +28,25 @@ export class SignalViewComponent {
|
|||||||
switchMap(({ handlingId }) => this.signalViewService.fetchSignal$(handlingId as string)),
|
switchMap(({ handlingId }) => this.signalViewService.fetchSignal$(handlingId as string)),
|
||||||
shareReplay(1)
|
shareReplay(1)
|
||||||
);
|
);
|
||||||
typeToText(type: string) {
|
typeToText(type: string): string {
|
||||||
if (type === 'arbete') {
|
switch (type) {
|
||||||
return 'Arbete';
|
case 'arbete':
|
||||||
|
return 'Arbete';
|
||||||
|
case 'utbildning':
|
||||||
|
return 'Utbildning';
|
||||||
|
default:
|
||||||
|
return 'Okänd';
|
||||||
}
|
}
|
||||||
if (type === 'utbildning') {
|
|
||||||
return 'Utbildning';
|
|
||||||
}
|
|
||||||
return 'Okänd';
|
|
||||||
}
|
}
|
||||||
omfattningToText(omfattning: string) {
|
omfattningToText(omfattning: string): string {
|
||||||
if (omfattning === 'heltid') {
|
switch (omfattning) {
|
||||||
return 'Heltid';
|
case 'heltid':
|
||||||
|
return 'Heltid';
|
||||||
|
case 'deltid':
|
||||||
|
return 'Deltid';
|
||||||
|
default:
|
||||||
|
return 'Okänd';
|
||||||
}
|
}
|
||||||
if (omfattning === 'deltid') {
|
|
||||||
return 'Deltid';
|
|
||||||
}
|
|
||||||
return 'Okänd';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private signalViewService: SignalViewService, private activatedRoute: ActivatedRoute) {}
|
constructor(private signalViewService: SignalViewService, private activatedRoute: ActivatedRoute) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user