20 lines
575 B
JavaScript
20 lines
575 B
JavaScript
const { listSurveys, surveyStats, getTmUsers, getDoctors, getPatients, } = require('../controllers/dashboardController');
|
|
const { requireAuth } = require('../middleware/auth');
|
|
|
|
const authed = (path, handler) => ({
|
|
method: 'GET',
|
|
path,
|
|
options: {
|
|
pre: [{ method: requireAuth }],
|
|
},
|
|
handler,
|
|
});
|
|
|
|
module.exports = [
|
|
authed('/api/dashboard/stats', surveyStats),
|
|
authed('/api/dashboard/surveys', listSurveys),
|
|
authed('/api/dashboard/tm-users', getTmUsers),
|
|
authed('/api/dashboard/doctors', getDoctors),
|
|
authed('/api/dashboard/patients', getPatients),
|
|
];
|