mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-21 08:42:27 +00:00
Add case for planet deletion
This commit is contained in:
parent
f1b44af420
commit
8ecca5d358
3 changed files with 15 additions and 5 deletions
|
@ -10,7 +10,7 @@ using IOFile = System.IO.File;
|
||||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Admin;
|
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Admin;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("admin/user/{id:int}")]
|
[Route("moderation/user/{id:int}")]
|
||||||
public class AdminUserController : ControllerBase
|
public class AdminUserController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly Database database;
|
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();
|
await this.database.SaveChangesAsync();
|
||||||
|
|
||||||
return this.Redirect($"/user/{targetedUser.UserId}");
|
return this.Redirect($"/user/{targetedUser.UserId}");
|
||||||
|
|
|
@ -12,7 +12,7 @@ public enum CaseType
|
||||||
UserDeletion = 3,
|
UserDeletion = 3,
|
||||||
UserCommentsDisabled = 4,
|
UserCommentsDisabled = 4,
|
||||||
UserDetailsEdited = 5,
|
UserDetailsEdited = 5,
|
||||||
UserEarthDeletion = 6,
|
UserPlanetsDeletion = 6,
|
||||||
|
|
||||||
LevelDeletion = 7,
|
LevelDeletion = 7,
|
||||||
LevelLock = 8,
|
LevelLock = 8,
|
||||||
|
@ -42,7 +42,7 @@ public static class CaseTypeExtensions
|
||||||
CaseType.UserBan => true,
|
CaseType.UserBan => true,
|
||||||
CaseType.UserCommentsDisabled => true,
|
CaseType.UserCommentsDisabled => true,
|
||||||
CaseType.UserDetailsEdited => true,
|
CaseType.UserDetailsEdited => true,
|
||||||
CaseType.UserEarthDeletion => true,
|
CaseType.UserPlanetsDeletion => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,16 @@ public class ModerationCase
|
||||||
CaseCreated = DateTime.Now,
|
CaseCreated = DateTime.Now,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endregion
|
public static ModerationCase NewPlanetDeletionCase(int caseCreator, int userId)
|
||||||
#endregion
|
=> new()
|
||||||
|
{
|
||||||
|
CaseType = CaseType.UserPlanetsDeletion,
|
||||||
|
CaseDescription = "",
|
||||||
|
CaseCreatorId = caseCreator,
|
||||||
|
CaseCreated = DateTime.Now,
|
||||||
|
AffectedId = userId,
|
||||||
|
};
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#endregion
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue