survey.controller.ts 451 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
8
9
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
0711    
Lee SeoYeon committed
10

Lee SeoYeon's avatar
Lee SeoYeon committed
11
12
13
14
// export const getSurveys = asyncWrap(async (req, res) => {
//   const surveys = await surveyDb.getSurveys();
//   return res.json(surveys);
// });