mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-07 04:18:38 +00:00
Add ability to hide comments on levels and profiles
This commit is contained in:
parent
0b8c0cbfb4
commit
8fe9bd4c57
12 changed files with 123 additions and 16 deletions
|
@ -28,13 +28,16 @@ public class NewCasePage : BaseLayout
|
|||
return this.Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPost(CaseType? type, string reason, string modNotes, DateTime expires, int? affectedId)
|
||||
public async Task<IActionResult> OnPost(CaseType? type, string? reason, string? modNotes, DateTime expires, int? affectedId)
|
||||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.Redirect("/login");
|
||||
|
||||
if (type == null) return this.BadRequest();
|
||||
if (affectedId == null) return this.BadRequest();
|
||||
|
||||
reason ??= string.Empty;
|
||||
modNotes ??= string.Empty;
|
||||
|
||||
// this is fucking ugly
|
||||
// if id is invalid then return bad request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue