refactor(socket.io): deprecate SocketModules.chats.setNotificationSetting in favour of api.chats.watch

This commit is contained in:
Julian Lam
2023-11-16 11:23:39 -05:00
parent b13c6ee431
commit 75c8cda18c
7 changed files with 94 additions and 8 deletions

View File

@@ -88,6 +88,13 @@ Chats.mark = async (req, res) => {
helpers.formatApiResponse(200, res);
};
Chats.watch = async (req, res) => {
const state = req.method === 'DELETE' ? -1 : parseInt(req.body.value, 10) || -1;
await api.chats.watch(req, { state, ...req.params });
helpers.formatApiResponse(200, res);
};
Chats.users = async (req, res) => {
const { roomId } = req.params;
const start = parseInt(req.query.start, 10) || 0;