Order cars by name

This commit is contained in:
2025-06-20 21:02:38 +02:00
parent e13b5f2cdc
commit 9246729edf
2 changed files with 4 additions and 1 deletions

View File

@@ -81,7 +81,8 @@ export class EditEntryComponent implements OnInit {
.getAll() .getAll()
.pipe( .pipe(
takeUntilDestroyed(), takeUntilDestroyed(),
map(response => response.cars), map(response => response.cars
.sort((a, b) => a.name.localeCompare(b.name))),
tap(cars => { tap(cars => {
const selectedCarId = this.selectedCarService.getSelectedCarId(); const selectedCarId = this.selectedCarService.getSelectedCarId();

View File

@@ -99,6 +99,8 @@ export class EntriesComponent implements OnInit {
this.cars$ = this.entriesOverviewService.getCars() this.cars$ = this.entriesOverviewService.getCars()
.pipe( .pipe(
takeUntilDestroyed(), takeUntilDestroyed(),
map((cars) => cars
.sort((a, b) => a.name.localeCompare(b.name))),
tap((cars) => { tap((cars) => {
const selectedCarId = this.selectedCarService.getSelectedCarId(); const selectedCarId = this.selectedCarService.getSelectedCarId();