Add proper relationships to Comments (#838)

* Add specific foreign keys for comment targets

* Remove inheritdoc tags from migration

* Fix punctuation of deleted comment message and add mod deletion message

* Fix broken merge

* Cleanup comment queries
This commit is contained in:
Josh 2023-08-24 13:58:03 -05:00 committed by GitHub
parent 9cb9fb62e4
commit a316c866c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 192 additions and 45 deletions

View file

@ -96,7 +96,7 @@ public class UserPage : BaseLayout
this.Comments = await this.Database.Comments.Include(p => p.Poster)
.OrderByDescending(p => p.Timestamp)
.Where(p => p.TargetId == userId && p.Type == CommentType.Profile)
.Where(p => p.TargetUserId == userId && p.Type == CommentType.Profile)
.Where(p => !blockedUsers.Contains(p.PosterUserId))
.Take(50)
.ToDictionaryAsync(c => c, _ => (RatedCommentEntity?)null);