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

catchErrors

parent da6e69af
...@@ -2,6 +2,7 @@ import React, { useState } from "react"; ...@@ -2,6 +2,7 @@ import React, { useState } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { surveyApi } from "../apis"; import { surveyApi } from "../apis";
import { SurveyType } from "../types"; import { SurveyType } from "../types";
import { catchErrors } from "../helpers";
type Props = { type Props = {
data: SurveyType; data: SurveyType;
...@@ -31,7 +32,7 @@ export const MySurveyCard = ({ data }: Props) => { ...@@ -31,7 +32,7 @@ export const MySurveyCard = ({ data }: Props) => {
} }
} catch (error) { } catch (error) {
console.log("에러발생"); console.log("에러발생");
// catchErrors(error, setError) catchErrors(error, setError);
} finally { } finally {
setLoading(false); setLoading(false);
} }
......
...@@ -4,11 +4,6 @@ import { surveyApi } from "../apis"; ...@@ -4,11 +4,6 @@ import { surveyApi } from "../apis";
import { SurveyType } from "../types"; import { SurveyType } from "../types";
import { MySurveyCard } from "./MySurveyCard"; 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 = () => { export const Profile = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const [survey, setSurvey] = useState<SurveyType>({ 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