mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 00:18:39 +00:00
Add mod notes to ban cases, improve case display
This commit is contained in:
parent
cdcc03fdc1
commit
7ba50e26f5
6 changed files with 30 additions and 18 deletions
|
@ -26,7 +26,7 @@ public class ModeratorBanUserPage : BaseLayout
|
|||
return this.Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPost([FromRoute] int id, string reason, DateTime caseExpires)
|
||||
public async Task<IActionResult> OnPost([FromRoute] int id, string reason, string modNotes, DateTime caseExpires)
|
||||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.NotFound();
|
||||
|
@ -44,7 +44,7 @@ public class ModeratorBanUserPage : BaseLayout
|
|||
this.Database.WebTokens.RemoveRange(this.Database.WebTokens.Where(t => t.UserId == this.TargetedUser.UserId));
|
||||
|
||||
// generate & add moderation case
|
||||
this.Database.Add(ModerationCase.NewBanCase(user.UserId, this.TargetedUser.UserId, reason, caseExpires));
|
||||
this.Database.Add(ModerationCase.NewBanCase(user.UserId, this.TargetedUser.UserId, reason, modNotes, caseExpires));
|
||||
|
||||
await this.Database.SaveChangesAsync();
|
||||
return this.Redirect($"/user/{this.TargetedUser.UserId}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue