chats.js 685 B

1234567891011121314151617
  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. .delete('/both/:id', guard, controllers.removeChatForBoth);
  15. module.exports = router;