fix(portfolio): apiFetch에서 Content-Type 헤더가 options.headers에 덮여 사라지는 문제 수정

PUT /api/profile/profile 등 인증 헤더를 함께 보내는 요청에서 Content-Type이
빠져 FastAPI가 body를 JSON으로 파싱하지 못해 422를 반환하던 문제. spread 순서를
뒤집어 options 펼친 뒤 headers를 마지막에 머지하도록 수정.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 02:01:14 +09:00
parent a50c6c8be2
commit 60655f8ba9

View File

@@ -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 }));