Add player action logging for admin operations

Introduces a new addPlayerAction method in adminRepository and logPlayerAction in adminService to record admin actions on player accounts. Updates relevant admin routes to log actions such as bans, unbans, forced name changes, and skin resets. Also improves error messages in adminService for consistency and clarity.
This commit is contained in:
2026-01-05 05:06:06 +01:00
parent 439094013d
commit bfad2a39c1
5 changed files with 43 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ const adminService = require("../../../services/adminService")
router.delete("/skin/:uuid", adminService.hasPermission("RESET_PLAYER_SKIN"), async (req, res) => {
const result = await userService.resetSkin(req.params.uuid)
await adminService.logPlayerAction("USING_BANNED_SKIN")
return res.status(200).json(result)
})

View File

@@ -6,6 +6,7 @@ const adminService = require("../../../services/adminService")
router.patch("/:uuid", adminService.hasPermission("CHANGE_PLAYER_USERNAME"), async (req, res) => {
const { newUsername } = req.body
const result = await userService.changeUsername(req.params.uuid, newUsername)
await adminService.logPlayerAction("FORCED_NAME_CHANGE")
return res.status(200).json(result)
})