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:
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user