refactor(socket.io): deprecated SocketModules.chats.toggleOwner in favour of api.chats.toggleOwner

This commit is contained in:
Julian Lam
2023-11-15 15:06:42 -05:00
parent 932bd29200
commit b13c6ee431
7 changed files with 95 additions and 15 deletions

View File

@@ -126,6 +126,12 @@ Chats.kickUser = async (req, res) => {
helpers.formatApiResponse(200, res, users);
};
Chats.toggleOwner = async (req, res) => {
const state = req.method === 'PUT';
await api.chats.toggleOwner(req, { state, ...req.params });
helpers.formatApiResponse(200, res);
};
Chats.messages = {};
Chats.messages.list = async (req, res) => {
const uid = req.query.uid || req.uid;