Rename deleteGlobalCape to deleteCape

Refactored the function and route handler from deleteGlobalCape to deleteCape for consistency and clarity in naming. Updated all references accordingly.
This commit is contained in:
Gilles Lazures 2026-01-05 05:07:53 +01:00
parent bfad2a39c1
commit 5b81f57adb
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ router.post("/upload", adminService.hasPermission("UPLOAD_CAPE"), upload.single(
}) })
router.delete("/:hash", adminService.hasPermission("DELETE_CAPES"), async (req, res) => { router.delete("/:hash", adminService.hasPermission("DELETE_CAPES"), async (req, res) => {
const result = await userService.deleteGlobalCape(req.params.hash) const result = await userService.deleteCape(req.params.hash)
res.status(200).json(result) res.status(200).json(result)
}) })

View File

@ -125,7 +125,7 @@ async function uploadCape(fileObject, alias = null) {
return { hash, url: textureUrl } return { hash, url: textureUrl }
} }
async function deleteGlobalCape(hash) { async function deleteCape(hash) {
const success = await userRepository.deleteTexture(hash) const success = await userRepository.deleteTexture(hash)
if (!success) throw new DefaultError(404, "Cape not found.") if (!success) throw new DefaultError(404, "Cape not found.")
@ -145,7 +145,7 @@ module.exports = {
grantPermission, grantPermission,
revokePermission, revokePermission,
checkAdminAccess, checkAdminAccess,
deleteGlobalCape, deleteCape,
logPlayerAction, logPlayerAction,
changeAdminPassword, changeAdminPassword,
} }