mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-13 00:31:28 +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
|
@ -59,13 +59,13 @@ public class ModerationRemovalController : ControllerBase
|
|||
switch (comment.Type)
|
||||
{
|
||||
case CommentType.Level:
|
||||
int slotCreatorId = await this.database.Slots.Where(s => s.SlotId == comment.TargetId)
|
||||
int slotCreatorId = await this.database.Slots.Where(s => s.SlotId == comment.TargetSlotId)
|
||||
.Select(s => s.CreatorId)
|
||||
.FirstOrDefaultAsync();
|
||||
canDelete = user.UserId == comment.PosterUserId || user.UserId == slotCreatorId;
|
||||
break;
|
||||
case CommentType.Profile:
|
||||
canDelete = user.UserId == comment.PosterUserId || user.UserId == comment.TargetId;
|
||||
canDelete = user.UserId == comment.PosterUserId || user.UserId == comment.TargetUserId;
|
||||
break;
|
||||
default: throw new ArgumentOutOfRangeException(nameof(commentId));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue