mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-27 01:39:53 +01:00
refactor(socket.io): deprecate SocketModules.sortPublicRooms in favour of api.chats.sortPublicRooms
This commit is contained in:
@@ -68,7 +68,6 @@ Categories.setWatchState = async (req, res) => {
|
||||
} else if (Object.keys(categories.watchStates).includes(state)) {
|
||||
state = categories.watchStates[state]; // convert to integer for backend processing
|
||||
} else {
|
||||
console.log('throwing', cid, uid, state);
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@ Chats.create = async (req, res) => {
|
||||
// currently only returns unread count, but open-ended for future additions if warranted.
|
||||
Chats.getUnread = async (req, res) => helpers.formatApiResponse(200, res, await api.chats.getUnread(req));
|
||||
|
||||
Chats.sortPublicRooms = async (req, res) => {
|
||||
const { roomIds, scores } = req.body;
|
||||
await api.chats.sortPublicRooms(req, { roomIds, scores });
|
||||
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Chats.exists = async (req, res) => {
|
||||
// yes, this is fine. Room existence is checked via middleware :)
|
||||
helpers.formatApiResponse(200, res);
|
||||
|
||||
Reference in New Issue
Block a user