survey.controller.ts 451 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
8
import { surveyDb } from "../db";
import { asyncWrap } from "../helpers/asyncWrap";

export const createSurvey = asyncWrap(async (req, res) => {
  const survey = req.body;
  console.log("Survey body", survey);
  const newSurvey = await surveyDb.createSurvey(survey);
  return res.json(newSurvey);
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
9
10
11
12
13
14
});

// export const getSurveys = asyncWrap(async (req, res) => {
//   const surveys = await surveyDb.getSurveys();
//   return res.json(surveys);
// });