Falukant production, family and administration enhancements
This commit is contained in:
@@ -89,6 +89,43 @@ class AdminController {
|
||||
res.status(error.status || 500).json({ error: error.message || 'Internal Server Error' });
|
||||
}
|
||||
}
|
||||
|
||||
async searchUser(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const { userName, characterName } = req.body;
|
||||
const response = await AdminService.getFalukantUser(userId, userName, characterName);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(403).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
async getFalukantUserById(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const { id: hashedId } = req.params;
|
||||
const response = await AdminService.getFalukantUserById(userId, hashedId);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(403).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
async changeFalukantUser(req, res) {
|
||||
try {
|
||||
const { userid: userId } = req.headers;
|
||||
const data = req.body;
|
||||
const { id: falukantUserId, } = req.body;
|
||||
const response = await AdminService.changeFalukantUser(userId, falukantUserId, data);
|
||||
res.status(200).json(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.status(403).json({ error: error.message });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default AdminController;
|
||||
|
||||
Reference in New Issue
Block a user