const { body } = require('express-validator');
const {
  getMyManagers,
  createManager,
  updateManager,
  deleteManager,
  getHostsIManage,
} = require('../../../controllers/host/v1.1/managers');
const { isAuth, validation } = require('../../../middlewares');

const router = require('express').Router();

router.get('/', isAuth, getMyManagers);
router.post('/', isAuth, createManager);
router.patch(
  '/',
  isAuth,
  [body('status').isIn(['Accepted', 'Declined']).optional(), validation],
  updateManager,
);
router.delete('/', isAuth, deleteManager);
router.get('/hosts', isAuth, getHostsIManage);

module.exports = router;
