New Angular based web version #1

Closed
thomas.nuyken wants to merge 150 commits from main into ddd
2 changed files with 7 additions and 4 deletions
Showing only changes of commit feadab4dff - Show all commits

View File

@@ -34,10 +34,12 @@ export class EntriesOverviewService {
return combineLatest([this.cachedCars$!, entries$])
.pipe(
map(([cars, entries]) => {
return entries.map((entry): Consumption => ({
...entry,
car: cars.find(car => car.id === entry.carId)!
}));
return entries
.sort((a, b) => b.dateTime.localeCompare(a.dateTime))
.map((entry): Consumption => ({
...entry,
car: cars.find(car => car.id === entry.carId)!
}));
})
)
}

View File

@@ -41,6 +41,7 @@ public static class GetConsumptions
CancellationToken cancellationToken)
{
List<ResponseDto> consumptions = await dbContext.Consumptions
.OrderByDescending(x => x.DateTime)
.Select(x =>
new ResponseDto(x.Id.Value, x.DateTime, x.Distance, x.Amount, x.IgnoreInCalculation, x.CarId.Value))
.ToListAsync(cancellationToken);