공통코드 조회기능 추가

This commit is contained in:
JIeunhuh
2025-05-29 16:15:38 +09:00
parent 982c4124bc
commit 6911d5cab4
4 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ export const putData = async (url: string, data: object): Promise<any> => {
};
export const getData = async (url: string): Promise<any> => {
const res = await fetch(`${BASE_URL}/${url}`, {
const res = await fetch(url.startsWith('/') ? `${url}` : `${BASE_URL}/${url}`, {
method: "GET",
});
if (res.ok) {