diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/DevHive.Services/Services/PostService.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/DevHive.Services/Services/PostService.cs b/src/DevHive.Services/Services/PostService.cs index 3206479..8002468 100644 --- a/src/DevHive.Services/Services/PostService.cs +++ b/src/DevHive.Services/Services/PostService.cs @@ -65,6 +65,11 @@ namespace DevHive.Services.Services Post post = await this._postRepository.GetByIdAsync(id) ?? throw new ArgumentException("The post does not exist!"); + // This can't happen in repo, because of how time is usually compared + post.Comments = post.Comments + .OrderByDescending(x => x.TimeCreated.ToFileTimeUtc()) + .ToList(); + User user = await this._userRepository.GetByIdAsync(post.Creator.Id) ?? throw new ArgumentException("The user does not exist!"); |
