mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 16:08:38 +00:00
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:
parent
9cb9fb62e4
commit
a316c866c5
13 changed files with 192 additions and 45 deletions
|
@ -57,9 +57,9 @@ public class SlotPage : BaseLayout
|
|||
this.CommentsEnabled = ServerConfiguration.Instance.UserGeneratedContentLimits.LevelCommentsEnabled && this.Slot.CommentsEnabled;
|
||||
if (this.CommentsEnabled)
|
||||
{
|
||||
this.Comments = await this.Database.Comments.Include(p => p.Poster)
|
||||
.OrderByDescending(p => p.Timestamp)
|
||||
.Where(c => c.TargetId == id && c.Type == CommentType.Level)
|
||||
this.Comments = await this.Database.Comments.Include(c => c.Poster)
|
||||
.OrderByDescending(c => c.Timestamp)
|
||||
.Where(c => c.Type == CommentType.Level && c.TargetSlotId == id)
|
||||
.Where(c => !blockedUsers.Contains(c.PosterUserId))
|
||||
.Include(c => c.Poster)
|
||||
.Where(c => c.Poster.PermissionLevel != PermissionLevel.Banned)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue