Commit a4cbdf12 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

catchErrors

parent da6e69af
......@@ -2,6 +2,7 @@ import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { surveyApi } from "../apis";
import { SurveyType } from "../types";
import { catchErrors } from "../helpers";
type Props = {
data: SurveyType;
......@@ -31,7 +32,7 @@ export const MySurveyCard = ({ data }: Props) => {
}
} catch (error) {
console.log("에러발생");
// catchErrors(error, setError)
catchErrors(error, setError);
} finally {
setLoading(false);
}
......
......@@ -4,11 +4,6 @@ import { surveyApi } from "../apis";
import { SurveyType } from "../types";
import { MySurveyCard } from "./MySurveyCard";
const testData = [
{ id: 0, name: "이름1", description: "설명1" },
{ id: 1, name: "이름2", description: "설명2" },
{ id: 2, name: "이름3", description: "설명3" },
];
export const Profile = () => {
const navigate = useNavigate();
const [survey, setSurvey] = useState<SurveyType>({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment