feat(AdminController, AdminService, AdminRouter, localization): add character death cleanup feature
All checks were successful
Deploy to production / deploy (push) Successful in 1m52s
All checks were successful
Deploy to production / deploy (push) Successful in 1m52s
- Implemented `adminCleanupCharacterDeathArtifacts` method in AdminService to remove stale character-bound data after death/inheritance, including knowledge, debtors prism, and political offices. - Added corresponding route in AdminRouter for triggering the cleanup process via an API endpoint. - Enhanced AdminController to handle requests for the new cleanup feature, ensuring proper error handling and response formatting. - Updated frontend components to include a user interface for initiating the cleanup, with localization support in both English and German for improved user experience.
This commit is contained in:
@@ -16,6 +16,7 @@ class AdminController {
|
||||
this.adminForceFalukantPregnancy = this.adminForceFalukantPregnancy.bind(this);
|
||||
this.adminClearFalukantPregnancy = this.adminClearFalukantPregnancy.bind(this);
|
||||
this.adminForceFalukantBirth = this.adminForceFalukantBirth.bind(this);
|
||||
this.adminCleanupCharacterDeathArtifacts = this.adminCleanupCharacterDeathArtifacts.bind(this);
|
||||
this.adminGetPotentialFathersForCharacter = this.adminGetPotentialFathersForCharacter.bind(this);
|
||||
this.getFalukantUserBranches = this.getFalukantUserBranches.bind(this);
|
||||
this.updateFalukantStock = this.updateFalukantStock.bind(this);
|
||||
@@ -507,6 +508,21 @@ class AdminController {
|
||||
}
|
||||
}
|
||||
|
||||
async adminCleanupCharacterDeathArtifacts(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const { characterId } = req.params;
|
||||
const response = await AdminService.adminCleanupCharacterDeathArtifacts(userId, characterId);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
const status = error.message === 'noaccess'
|
||||
? 403
|
||||
: (['invalidCharacter', 'notfound'].includes(error.message) ? 400 : 500);
|
||||
res.status(status).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
async getFalukantUserBranches(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
|
||||
Reference in New Issue
Block a user