물 하수재이용 등록 사업 작업중
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user