answer.api.ts 387 Bytes
Newer Older
1
2
3
4
5
6
7
8
import axios from "axios";
import { AnswerType } from "../types";
import baseUrl from "./baseUrl";

export const saveAnswers = async (answer: FormData) => {
  const { data } = await axios.post(`${baseUrl}/answers`, answer);
  return data;
};
Jiwon Yoon's avatar
Jiwon Yoon committed
9
10
11
12
13

export const getAnswers = async (surveyId: string) => {
  const { data } = await axios.get(`${baseUrl}/answers/${surveyId}`);
  return data;
};