diff --git a/frontend/src/Deposit.jsx b/frontend/src/Deposit.jsx index ce2198c..500de27 100644 --- a/frontend/src/Deposit.jsx +++ b/frontend/src/Deposit.jsx @@ -5,6 +5,7 @@ import { useEffect, useState } from "react"; const Deposit = () => { const [deposit, setDeposit] = useState(null); + useEffect(() => { const user = JSON.parse(localStorage.getItem("user")); const userId = user?.id; @@ -12,7 +13,9 @@ const Deposit = () => { if (!userId) return; axios - .get(`/api/deposit/${userId}`) + .get(`/api/deposit/${userId}`, { + withCredentials: true, // 세션 쿠키 포함 + }) .then((res) => setDeposit(res.data)) .catch((err) => { alert("보증금 정보를 불러오지 못했습니다."); diff --git a/frontend/src/api/assignment.js b/frontend/src/api/assignment.js index 4102105..a576b62 100644 --- a/frontend/src/api/assignment.js +++ b/frontend/src/api/assignment.js @@ -1,5 +1,8 @@ import axios from "axios"; export const fetchAssignmentsByUser = async (userId) => { - const res = await axios.get(`/api/assignment/grouped/${userId}`); return res.data; + const res = await axios.get(`/api/assignment/grouped/${userId}`, { + withCredentials: true + }); + return res.data; };