-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from sharemindteam/feat/open_consult_share_294
[Feature] 셰어 공개상담 개발 요청 사항 반영 / react-query 반영
- Loading branch information
Showing
47 changed files
with
1,461 additions
and
619 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import { instance, publicInstance } from './axios'; | ||
|
||
// | ||
// | ||
// | ||
|
||
export const getInstance = async (url: string, params?: any) => { | ||
try { | ||
const data = await instance.get(url, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
export const postInstance = async (url: string, body: any, params?: any) => { | ||
try { | ||
const data = await instance.post(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
export const putInstance = async (url: string, body: any, params: any) => { | ||
try { | ||
const data = await instance.put(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
export const patchInstance = async (url: string, body?: any, params?: any) => { | ||
try { | ||
const data = await instance.patch(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
export const deleteInstance = async (url: string, body?: any) => { | ||
try { | ||
const config = { | ||
data: body, | ||
}; | ||
const data = await instance.delete(url, config); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
// | ||
// | ||
// | ||
|
||
export const getPublicInstance = async (url: string, params?: any) => { | ||
try { | ||
const data = await publicInstance.get(url, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
export const postPublicInstance = async ( | ||
url: string, | ||
body: any, | ||
params?: any, | ||
) => { | ||
try { | ||
const data = await publicInstance.post(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
export const putPublicInstance = async ( | ||
url: string, | ||
body: any, | ||
params: any, | ||
) => { | ||
try { | ||
const data = await publicInstance.put(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
export const patchPublicInstance = async ( | ||
url: string, | ||
body?: any, | ||
params?: any, | ||
) => { | ||
try { | ||
const data = await publicInstance.patch(url, body, params); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
export const deletePublicInstance = async (url: string, body?: any) => { | ||
try { | ||
const config = { | ||
data: body, | ||
}; | ||
const data = await publicInstance.delete(url, config); | ||
return data; | ||
} catch (error) { | ||
return error; | ||
} | ||
}; | ||
|
||
// | ||
// | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.