CreateSurvey.tsx 603 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
import React from "react";
import { surveyApi } from "../apis";
3
import { useSurveys } from "../layouts";
Yoon, Daeki's avatar
Yoon, Daeki committed
4
5
6
7
import { ISurvey } from "../types";
import { ModifySurvey } from "./ModifySurvey";

export const CreateSurvey = () => {
8
9
  const { error, loading, create } = useSurveys();

Yoon, Daeki's avatar
Yoon, Daeki committed
10
11
12
13
14
15
16
17
  const surveyData = {
    _id: "",
    user: "",
    title: "",
    comment: "",
    questions: [],
  };

18
19
20
21
  // const create = async (surveyData: ISurvey) => {
  //   const result = await surveyApi.createSurvey(surveyData);
  //   return result;
  // };
Yoon, Daeki's avatar
Yoon, Daeki committed
22
23
24

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