refactor(socket.io): deprecate SocketModules.chat.getUnreadCount in favour of api.chats.getUnread

This commit is contained in:
Julian Lam
2023-11-14 12:19:23 -05:00
parent 214989a8c1
commit 5eaffb422c
7 changed files with 43 additions and 4 deletions

View File

@@ -29,6 +29,9 @@ Chats.create = async (req, res) => {
helpers.formatApiResponse(200, res, roomObj);
};
// 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.exists = async (req, res) => {
// yes, this is fine. Room existence is checked via middleware :)
helpers.formatApiResponse(200, res);