survey.route.ts 470 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
import express from "express";
Jiwon Yoon's avatar
Jiwon Yoon committed
2
import { authCtrl, surveyCtrl } from "../controllers";
Jiwon Yoon's avatar
Jiwon Yoon committed
3
4
5

const router = express.Router();

Jiwon Yoon's avatar
Jiwon Yoon committed
6
router.route("/create").post(authCtrl.requireLogin, surveyCtrl.createSurvey);
Jiwon Yoon's avatar
Jiwon Yoon committed
7
router
Jiwon Yoon's avatar
Jiwon Yoon committed
8
9
10
11
12
  .route("/edit/:surveyId")
  .get(authCtrl.requireLogin, authCtrl.authenticate, surveyCtrl.getSurveyById)
  .put(authCtrl.requireLogin, authCtrl.authenticate, surveyCtrl.updateSurvey);

router.param("surveyId", surveyCtrl.userBySurveyId);
Jiwon Yoon's avatar
Jiwon Yoon committed
13
14

export default router;