From 9c393f9137c067972322059ed46aa331faeecdad Mon Sep 17 00:00:00 2001 From: HYOJIN Date: Thu, 26 Mar 2026 16:31:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20JSON=20=EC=83=98=ED=94=8C=20=ED=8C=8C?= =?UTF-8?q?=EC=8B=B1=20=EC=8B=9C=20=EC=9D=B4=EC=A4=91=20=EC=A7=81=EB=A0=AC?= =?UTF-8?q?=ED=99=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 parseJson API 호출 시 이미 JSON 문자열인 body를 JSON.stringify로 다시 감싸는 문제 수정 Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/api/bypassApi.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/bypassApi.ts b/frontend/src/api/bypassApi.ts index 62ca2cc..29241e1 100644 --- a/frontend/src/api/bypassApi.ts +++ b/frontend/src/api/bypassApi.ts @@ -116,8 +116,15 @@ export const bypassApi = { deleteJson>(`${BASE}/${id}`), generateCode: (id: number, force = false) => postJson>(`${BASE}/${id}/generate?force=${force}`), - parseJson: (jsonSample: string) => - postJson>(`${BASE}/parse-json`, jsonSample), + parseJson: async (jsonSample: string): Promise> => { + const res = await fetch(`${BASE}/parse-json`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: jsonSample, // 이미 JSON 문자열이므로 JSON.stringify 하지 않음 + }); + if (!res.ok) throw new Error(`API Error: ${res.status} ${res.statusText}`); + return res.json(); + }, getWebclientBeans: () => fetchJson>(`${BASE}/webclient-beans`), };