feat: POST /chats/:roomId/:mid and DELETE /chats/:roomId/:mid

This commit is contained in:
Julian Lam
2021-12-20 15:00:43 -05:00
parent 90fcbe4416
commit d5fd098ecf
7 changed files with 178 additions and 20 deletions

View File

@@ -80,5 +80,15 @@ Chats.messages.edit = async (req, res) => {
};
Chats.messages.delete = async (req, res) => {
// ...
await messaging.canDelete(req.params.mid, req.uid);
await messaging.deleteMessage(req.params.mid, req.uid);
helpers.formatApiResponse(200, res);
};
Chats.messages.restore = async (req, res) => {
await messaging.canDelete(req.params.mid, req.uid);
await messaging.restoreMessage(req.params.mid, req.uid);
helpers.formatApiResponse(200, res);
};