import { useState, useEffect } from 'react'; import { Link } from "react-router-dom"; import StudyPlanCard from "./StudyPlanCard"; import subjectApi from '../../apis/subject.api'; import catchErrors from "../../utils/catchErrors"; import { useAuth } from "../../utils/context"; import styles from "./studyplan.module.scss"; const StudyPlanList = () => { const { user } = useAuth(); const [renList, setRenList] = useState([]) const [error, setError] = useState("") useEffect(() => { getList(user.id); }, []) async function getList(userId) { try { setError("") const result = await subjectApi.allSubject(userId) setRenList(result) } catch (error) { catchErrors(error, setError) } } return (
새로운 과목 추가하기