2021-10-11 14:03:31 +03:00
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
|
|
|
|
2021-11-11 18:18:31 +03:00
|
|
|
// middleware
|
|
|
|
const { auth, requireAuth } = require('../middleware');
|
|
|
|
|
2021-10-11 14:03:31 +03:00
|
|
|
const {
|
|
|
|
getQueries,
|
|
|
|
addQuery,
|
|
|
|
deleteQuery,
|
2021-10-11 14:55:53 +03:00
|
|
|
updateQuery,
|
2021-10-11 14:03:31 +03:00
|
|
|
} = require('../controllers/queries/');
|
|
|
|
|
2021-11-11 18:18:31 +03:00
|
|
|
router.route('/').post(auth, requireAuth, addQuery).get(getQueries);
|
|
|
|
router
|
|
|
|
.route('/:prefix')
|
|
|
|
.delete(auth, requireAuth, deleteQuery)
|
|
|
|
.put(auth, requireAuth, updateQuery);
|
2021-10-11 14:03:31 +03:00
|
|
|
|
|
|
|
module.exports = router;
|