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`), };