From 559a00c18104acb9ad0a298886b23df50cb338ec Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Sun, 29 Oct 2023 11:14:00 +0100 Subject: [PATCH] Added sorting by creation date --- Moonlight/Shared/Components/Community/PostView.razor | 1 + Moonlight/Shared/Views/Community/Events.razor | 1 + Moonlight/Shared/Views/Community/Index.razor | 1 + Moonlight/Shared/Views/Community/Projects.razor | 1 + 4 files changed, 4 insertions(+) diff --git a/Moonlight/Shared/Components/Community/PostView.razor b/Moonlight/Shared/Components/Community/PostView.razor index 3f342469..1ecaac4a 100644 --- a/Moonlight/Shared/Components/Community/PostView.razor +++ b/Moonlight/Shared/Components/Community/PostView.razor @@ -177,6 +177,7 @@ .ThenInclude(x => x.Author) .First(x => x.Id == Post.Id) .Comments + .OrderBy(x => x.CreatedAt) .ToArray(); return Task.CompletedTask; diff --git a/Moonlight/Shared/Views/Community/Events.razor b/Moonlight/Shared/Views/Community/Events.razor index 916d2bfb..a7a4d971 100644 --- a/Moonlight/Shared/Views/Community/Events.razor +++ b/Moonlight/Shared/Views/Community/Events.razor @@ -58,6 +58,7 @@ .Get() .Include(x => x.Author) .Where(x => x.Type == PostType.Event) + .OrderByDescending(x => x.CreatedAt) .ToArray(); return Task.CompletedTask; diff --git a/Moonlight/Shared/Views/Community/Index.razor b/Moonlight/Shared/Views/Community/Index.razor index 316e1b31..45a02050 100644 --- a/Moonlight/Shared/Views/Community/Index.razor +++ b/Moonlight/Shared/Views/Community/Index.razor @@ -59,6 +59,7 @@ .Get() .Include(x => x.Author) .Where(x => x.Type == PostType.Announcement) + .OrderByDescending(x => x.CreatedAt) .ToArray(); return Task.CompletedTask; diff --git a/Moonlight/Shared/Views/Community/Projects.razor b/Moonlight/Shared/Views/Community/Projects.razor index f7011a4a..6511b35a 100644 --- a/Moonlight/Shared/Views/Community/Projects.razor +++ b/Moonlight/Shared/Views/Community/Projects.razor @@ -50,6 +50,7 @@ .Get() .Include(x => x.Author) .Where(x => x.Type == PostType.Project) + .OrderByDescending(x => x.CreatedAt) .ToArray(); return Task.CompletedTask;