Added ordering for timeline entries
Some checks failed
Portfolio CI/CD / build (push) Failing after 17s
Portfolio CI/CD / test (push) Has been skipped
Portfolio CI/CD / publish (push) Has been skipped

This commit is contained in:
2026-02-20 22:43:54 +01:00
parent 2a9cb2b2fb
commit eeb6e5de6a
2 changed files with 64 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
if (!result.IsSuccessStatusCode) return [];
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
return data ?? [];
return data?.OrderBy(t => t.Date) ?? Enumerable.Empty<TimelineEntry>();
}
public async Task<IEnumerable<TimelineEntry>> GetFeaturedTimeline(CancellationToken ct) {
@@ -19,6 +19,6 @@ internal sealed class TimelineRepository(IHttpClientFactory factory) : ITimeline
if (!result.IsSuccessStatusCode) return [];
var data = await result.Content.ReadFromJsonAsync<IEnumerable<TimelineEntry>>(ct);
return data ?? [];
return data?.OrderBy(t => t.Date) ?? Enumerable.Empty<TimelineEntry>();
}
}