Skip to content

Commit

Permalink
refactor: Update lastMessageUpdatedAt field in MessageController
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelink committed Jun 25, 2024
1 parent e7f3db4 commit b6a2a78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/message.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit b6a2a78

Please sign in to comment.