Integrate HistoryFormatService into AppealComponent to filter inactive history items.

This commit is contained in:
akastijn 2025-08-06 00:31:30 +02:00
parent d1ba89acc8
commit eb72ce14cc

View File

@ -10,6 +10,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatFormFieldModule} from '@angular/material/form-field'; import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSelectModule} from '@angular/material/select'; import {MatSelectModule} from '@angular/material/select';
import {MatInputModule} from '@angular/material/input'; import {MatInputModule} from '@angular/material/input';
import {HistoryFormatService} from '@pages/reference/bans/history-format.service';
@Component({ @Component({
selector: 'app-appeal', selector: 'app-appeal',
@ -36,6 +37,7 @@ export class AppealComponent implements OnInit, AfterViewInit {
protected selectedPunishment = signal<PunishmentHistory | null>(null); protected selectedPunishment = signal<PunishmentHistory | null>(null);
constructor( constructor(
private historyFormatService: HistoryFormatService,
private appealApi: AppealsService, private appealApi: AppealsService,
private historyApi: HistoryService, private historyApi: HistoryService,
protected authService: AuthService, protected authService: AuthService,
@ -54,7 +56,7 @@ export class AppealComponent implements OnInit, AfterViewInit {
throw new Error('JWT subject is null, are you logged in?'); throw new Error('JWT subject is null, are you logged in?');
} }
this.historyApi.getAllHistoryForUUID(uuid).subscribe(history => { this.historyApi.getAllHistoryForUUID(uuid).subscribe(history => {
this.history.set(history); this.history.set(history.filter(item => this.historyFormatService.isActive(item)));
}) })
} }