chats.js 730 B

123456789101112131415161718
  1. const express = require('express');
  2. const router = express.Router();
  3. const guard = require('../helpers/guard');
  4. const controllers = require('../controllers/chats');
  5. const validation = require('../validation/chat');
  6. router
  7. .get('/', guard, controllers.listChats)
  8. .get('/:companionId', guard, controllers.getChatById)
  9. .post('/', guard, validation.startChat, controllers.startChat)
  10. .patch('/mute/', guard, controllers.muteChat)
  11. .patch('/sort/', guard, controllers.sortChat)
  12. .patch('/seen/', guard, controllers.seenChat)
  13. .patch('/typing/', guard, validation.typingChat, controllers.typingChat)
  14. .patch('/pin/', guard, controllers.pinChat)
  15. .delete('/both/:id', guard, controllers.removeChatForBoth);
  16. module.exports = router;