From b6a2a781368d3637dda55f1eb74694e057bac6fc Mon Sep 17 00:00:00 2001 From: xue Date: Tue, 25 Jun 2024 20:06:44 +0300 Subject: [PATCH] refactor: Update lastMessageUpdatedAt field in MessageController --- src/controllers/message.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/message.controller.ts b/src/controllers/message.controller.ts index d1f0f10..51ef4cf 100644 --- a/src/controllers/message.controller.ts +++ b/src/controllers/message.controller.ts @@ -200,11 +200,11 @@ export default class MessageController { env.APP_DATABASE, env.ROOMS_COLLECTION, roomId, - { $updatedAt: Date.now() } + { lastMessageUpdatedAt: Date.now() } ); room?.$id - ? console.log("room updated") - : console.log("room not updated"); + ? console.log("room lastMessageUpdatedAt updated") + : console.log("room lastMessageUpdatedAt not updated"); res.status(201).json(message); } else { console.log("message not created");