fix(AdminService, AdminController): enhance error handling and character deletion logic
All checks were successful
Deploy to production / deploy (push) Successful in 1m44s
All checks were successful
Deploy to production / deploy (push) Successful in 1m44s
- Updated error handling in AdminController to include 'targetnotdead' status for improved response accuracy. - Modified character deletion logic in AdminService to ensure correct target character is identified, especially when dealing with living characters, enhancing data integrity during cleanup operations. - Adjusted attributes fetched for characters to include 'health', facilitating better decision-making in deletion processes.
This commit is contained in:
@@ -518,7 +518,7 @@ class AdminController {
|
||||
console.log(error);
|
||||
const status = error.message === 'noaccess'
|
||||
? 403
|
||||
: (['invalidCharacter', 'notfound'].includes(error.message) ? 400 : 500);
|
||||
: (['invalidCharacter', 'notfound', 'targetnotdead'].includes(error.message) ? 400 : 500);
|
||||
res.status(status).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user