CreateSurvey.tsx 498 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import React from "react";
import { surveyApi } from "../apis";
import { ISurvey } from "../types";
import { ModifySurvey } from "./ModifySurvey";

export const CreateSurvey = () => {
  const surveyData = {
    _id: "",
    user: "",
    title: "",
    comment: "",
    questions: [],
  };

  const create = async (surveyData: ISurvey) => {
    const result = await surveyApi.createSurvey(surveyData);
    return result;
  };

  return <ModifySurvey surveyData={surveyData} callApi={create} />;
};