fix: JSON 샘플 파싱 시 이중 직렬화 문제 수정
parseJson API 호출 시 이미 JSON 문자열인 body를 JSON.stringify로 다시 감싸는 문제 수정 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
부모
951b6c759d
커밋
9c393f9137
@ -116,8 +116,15 @@ export const bypassApi = {
|
||||
deleteJson<ApiResponse<void>>(`${BASE}/${id}`),
|
||||
generateCode: (id: number, force = false) =>
|
||||
postJson<ApiResponse<CodeGenerationResult>>(`${BASE}/${id}/generate?force=${force}`),
|
||||
parseJson: (jsonSample: string) =>
|
||||
postJson<ApiResponse<BypassFieldDto[]>>(`${BASE}/parse-json`, jsonSample),
|
||||
parseJson: async (jsonSample: string): Promise<ApiResponse<BypassFieldDto[]>> => {
|
||||
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<ApiResponse<WebClientBeanInfo[]>>(`${BASE}/webclient-beans`),
|
||||
};
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user