From 60655f8ba9d64d64aeca190e9d676429524ea23e Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 28 Apr 2026 02:01:14 +0900 Subject: [PATCH] =?UTF-8?q?fix(portfolio):=20apiFetch=EC=97=90=EC=84=9C=20?= =?UTF-8?q?Content-Type=20=ED=97=A4=EB=8D=94=EA=B0=80=20options.headers?= =?UTF-8?q?=EC=97=90=20=EB=8D=AE=EC=97=AC=20=EC=82=AC=EB=9D=BC=EC=A7=80?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PUT /api/profile/profile 등 인증 헤더를 함께 보내는 요청에서 Content-Type이 빠져 FastAPI가 body를 JSON으로 파싱하지 못해 422를 반환하던 문제. spread 순서를 뒤집어 options 펼친 뒤 headers를 마지막에 머지하도록 수정. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/pages/portfolio/usePortfolioApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/portfolio/usePortfolioApi.js b/src/pages/portfolio/usePortfolioApi.js index c18117d..9533521 100644 --- a/src/pages/portfolio/usePortfolioApi.js +++ b/src/pages/portfolio/usePortfolioApi.js @@ -4,8 +4,8 @@ const BASE = '/api/profile'; async function apiFetch(path, options = {}) { const res = await fetch(`${BASE}${path}`, { - headers: { 'Content-Type': 'application/json', ...options.headers }, ...options, + headers: { 'Content-Type': 'application/json', ...options.headers }, }); if (!res.ok) { const err = await res.json().catch(() => ({ detail: res.statusText }));