chats.js 851 B

1234567891011121314151617181920
  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('/controllers/', guard, controllers.mediaControllersChat)
  12. .patch('/socketId/', guard, controllers.socketIdChat)
  13. .patch('/sort/', guard, controllers.sortChat)
  14. .patch('/seen/', guard, controllers.seenChat)
  15. .patch('/typing/', guard, validation.typingChat, controllers.typingChat)
  16. .patch('/pin/', guard, controllers.pinChat)
  17. .delete('/both/:id', guard, controllers.removeChatForBoth);
  18. module.exports = router;