Added ordering for timeline entries
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user