diff --git a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs index 949aeade..46e0448c 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserController.cs @@ -10,7 +10,7 @@ using IOFile = System.IO.File; namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Admin; [ApiController] -[Route("admin/user/{id:int}")] +[Route("moderation/user/{id:int}")] public class AdminUserController : ControllerBase { private readonly Database database; @@ -97,6 +97,7 @@ public class AdminUserController : ControllerBase } } + this.database.Cases.Add(ModerationCase.NewPlanetDeletionCase(user.UserId, targetedUser.UserId)); await this.database.SaveChangesAsync(); return this.Redirect($"/user/{targetedUser.UserId}"); diff --git a/ProjectLighthouse/Administration/CaseType.cs b/ProjectLighthouse/Administration/CaseType.cs index 3b8eabb5..3cc34938 100644 --- a/ProjectLighthouse/Administration/CaseType.cs +++ b/ProjectLighthouse/Administration/CaseType.cs @@ -12,7 +12,7 @@ public enum CaseType UserDeletion = 3, UserCommentsDisabled = 4, UserDetailsEdited = 5, - UserEarthDeletion = 6, + UserPlanetsDeletion = 6, LevelDeletion = 7, LevelLock = 8, @@ -42,7 +42,7 @@ public static class CaseTypeExtensions CaseType.UserBan => true, CaseType.UserCommentsDisabled => true, CaseType.UserDetailsEdited => true, - CaseType.UserEarthDeletion => true, + CaseType.UserPlanetsDeletion => true, _ => false, }; } diff --git a/ProjectLighthouse/Administration/ModerationCase.cs b/ProjectLighthouse/Administration/ModerationCase.cs index b5f205cb..2c392cea 100644 --- a/ProjectLighthouse/Administration/ModerationCase.cs +++ b/ProjectLighthouse/Administration/ModerationCase.cs @@ -88,7 +88,16 @@ public class ModerationCase CaseCreated = DateTime.Now, }; - #endregion - #endregion + public static ModerationCase NewPlanetDeletionCase(int caseCreator, int userId) + => new() + { + CaseType = CaseType.UserPlanetsDeletion, + CaseDescription = "", + CaseCreatorId = caseCreator, + CaseCreated = DateTime.Now, + AffectedId = userId, + }; + #endregion + #endregion } \ No newline at end of file