diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 8f9f5eb3e..2b6840323 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -810,7 +810,7 @@ export const toggleChatReadUnread = async (req: Req, res: Res): Promise => try{ const requestBody = JSON.parse(req.rawBody); //We want to mark the chat as read - if (req.shouldMarkAsUnread === false) { + if (requestBody.shouldMarkAsUnread === false) { // Call the readMessages function with the same req and res objects const result = await readMessages(req, res); return result; // Exit the function after calling readMessages