Added sorting by creation date

This commit is contained in:
Marcel Baumgartner 2023-10-29 11:14:00 +01:00
parent 122a205f92
commit 559a00c181
4 changed files with 4 additions and 0 deletions

View file

@ -177,6 +177,7 @@
.ThenInclude(x => x.Author)
.First(x => x.Id == Post.Id)
.Comments
.OrderBy(x => x.CreatedAt)
.ToArray();
return Task.CompletedTask;

View file

@ -58,6 +58,7 @@
.Get()
.Include(x => x.Author)
.Where(x => x.Type == PostType.Event)
.OrderByDescending(x => x.CreatedAt)
.ToArray();
return Task.CompletedTask;

View file

@ -59,6 +59,7 @@
.Get()
.Include(x => x.Author)
.Where(x => x.Type == PostType.Announcement)
.OrderByDescending(x => x.CreatedAt)
.ToArray();
return Task.CompletedTask;

View file

@ -50,6 +50,7 @@
.Get()
.Include(x => x.Author)
.Where(x => x.Type == PostType.Project)
.OrderByDescending(x => x.CreatedAt)
.ToArray();
return Task.CompletedTask;