mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 23:56:04 +02:00
refactor(socket.io): deprecate SocketModules.chats.isDnD in favour of api.users.getStatus
This commit is contained in:
@@ -66,6 +66,17 @@ Users.changePicture = async (req, res) => {
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Users.getStatus = async (req, res) => {
|
||||
helpers.formatApiResponse(200, res, await api.users.getStatus(req, { ...req.params }));
|
||||
};
|
||||
|
||||
Users.checkStatus = async (req, res) => {
|
||||
const { uid, status } = req.params;
|
||||
const { status: current } = await api.users.getStatus(req, { uid });
|
||||
|
||||
helpers.formatApiResponse(current === status ? 200 : 404, res);
|
||||
};
|
||||
|
||||
Users.updateSettings = async (req, res) => {
|
||||
const settings = await api.users.updateSettings(req, { ...req.body, uid: req.params.uid });
|
||||
helpers.formatApiResponse(200, res, settings);
|
||||
|
||||
Reference in New Issue
Block a user