Skip to content

Commit

Permalink
refactor: Commented code for updating room lastMessageUpdatedAt in Me…
Browse files Browse the repository at this point in the history
…ssageController
  • Loading branch information
xuelink committed Jun 25, 2024
1 parent 1259d8e commit ab57df4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/controllers/message.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ export default class MessageController {
if (message?.$id) {
console.log("message updated");
// Update room lastMessageUpdatedAt
let room = await database.updateDocument(
env.APP_DATABASE,
env.ROOMS_COLLECTION,
message.roomId.$id,
{ lastMessageUpdatedAt: new Date() }
);
room?.$id
? console.log("room lastMessageUpdatedAt updated")
: console.log("room lastMessageUpdatedAt not updated");
// let room = await database.updateDocument(
// env.APP_DATABASE,
// env.ROOMS_COLLECTION,
// message.roomId.$id,
// { lastMessageUpdatedAt: new Date() }
// );
// room?.$id
// ? console.log("room lastMessageUpdatedAt updated")
// : console.log("room lastMessageUpdatedAt not updated");
res.status(200).json(message);
} else {
console.log("message not updated");
Expand Down

0 comments on commit ab57df4

Please sign in to comment.