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)),
|
||||
shareReplay(1)
|
||||
);
|
||||
typeToText(type: string) {
|
||||
if (type === 'arbete') {
|
||||
return 'Arbete';
|
||||
typeToText(type: string): string {
|
||||
switch (type) {
|
||||
case 'arbete':
|
||||
return 'Arbete';
|
||||
case 'utbildning':
|
||||
return 'Utbildning';
|
||||
default:
|
||||
return 'Okänd';
|
||||
}
|
||||
if (type === 'utbildning') {
|
||||
return 'Utbildning';
|
||||
}
|
||||
return 'Okänd';
|
||||
}
|
||||
omfattningToText(omfattning: string) {
|
||||
if (omfattning === 'heltid') {
|
||||
return 'Heltid';
|
||||
omfattningToText(omfattning: string): string {
|
||||
switch (omfattning) {
|
||||
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) {}
|
||||
|
||||
Reference in New Issue
Block a user