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

@@ -79,6 +79,11 @@ chatsAPI.create = async function (caller, data) {
return await messaging.getRoomData(roomId);
};
chatsAPI.getUnread = async (caller) => {
const count = await messaging.getUnreadCount(caller.uid);
return { count };
};
chatsAPI.get = async (caller, { uid, roomId }) => await messaging.loadRoom(caller.uid, { uid, roomId });
chatsAPI.post = async (caller, data) => {