노후 하수관로 구현 작업 완료
This commit is contained in:
@@ -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> => {
|
||||
|
||||
Reference in New Issue
Block a user