물 하수재이용 등록 사업 작업중

This commit is contained in:
leedj312
2025-05-26 16:10:34 +09:00
parent 06f5400569
commit 2b18aa2c4b
9 changed files with 139 additions and 48 deletions
+5 -3
View File
@@ -20,11 +20,13 @@ export const getFetch = async( type:string , url: string) => {
return res.data;
}
export const postFectch = async (url: string, params: any) => {
export const postFectch = async (url: string, params: any , type?:string) => {
const div = type === fetchType.COMMON ? DEV_URL_FO : DEV_URL_WR
const response = await fetch(DEV_URL_WR+url, {
const response = await fetch(div+url, {
method: "POST",
headers: {
'accept': 'application/json',
"Content-Type": "application/json",
},
body: JSON.stringify(params),
@@ -32,7 +34,7 @@ export const postFectch = async (url: string, params: any) => {
if(!response.ok) {
throw new Error(`오류 발생: ${response.status}`);
}
return response;
return await response.json();
}