123456789101112131415161718 |
- const express = require('express');
- const router = express.Router();
- const guard = require('../helpers/guard');
- const controllers = require('../controllers/chats');
- const validation = require('../validation/chat');
- router
- .get('/', guard, controllers.listChats)
- .get('/:companionId', guard, controllers.getChatById)
- .post('/', guard, validation.startChat, controllers.startChat)
- .patch('/mute/', guard, controllers.muteChat)
- .patch('/sort/', guard, controllers.sortChat)
- .patch('/seen/', guard, controllers.seenChat)
- .patch('/typing/', guard, validation.typingChat, controllers.typingChat)
- .patch('/pin/', guard, controllers.pinChat)
- .delete('/both/:id', guard, controllers.removeChatForBoth);
- module.exports = router;
|