노후 하수관로 구현 작업 완료

This commit is contained in:
JIeunhuh
2025-05-27 13:18:55 +09:00
parent 92710d1ac7
commit 83845d6860
3 changed files with 21 additions and 16 deletions
+7 -2
View File
@@ -9,8 +9,13 @@ export const postData = async (url: string, data: object): Promise<any> => {
body: JSON.stringify(data),
};
const res = await fetch(`${BASE_URL}/${url}`, options);
const resData = await res.json();
return resData;
if (res.ok) {
const text = await res.text();
if (text) {
return JSON.parse(text); // JSON 데이터가 있으면 파싱하여 반환
}
return true; // 응답 본문이 비어 있으면 true 반환
}
};
export const postMutiPart = async (url: string, data: FormData): Promise<any> => {