-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
3,327 additions
and
2,223 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const localhost = "http://localhost:3000"; | ||
|
||
export const ProfileBodyApi = async () => { | ||
try { | ||
const url = new URL(`${localhost}/FITple/profile/body_info`); | ||
|
||
const response = await fetch(url, { | ||
method: "GET", | ||
credentials: "include", | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`서버 오류: ${response.status}`); | ||
} | ||
|
||
return await response.json(); | ||
} catch (error) { | ||
console.error("검색 요청 중 오류가 발생했습니다.", error); | ||
throw new 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const localhost = "http://localhost:3000"; | ||
|
||
export const ProfileFavorApi = async (category) => { | ||
try { | ||
const url = new URL(`${localhost}/FITple/profile/wish`); | ||
if (category) url.searchParams.append("category", category); | ||
const response = await fetch(url, { | ||
method: "GET", | ||
credentials: "include", | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`서버 오류: ${response.status}`); | ||
} | ||
|
||
return await response.json(); | ||
} catch (error) { | ||
console.error("검색 요청 중 오류가 발생했습니다.", error); | ||
throw new 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const localhost = "http://localhost:3000"; | ||
|
||
export const ProfileLoveApi = async (category) => { | ||
try { | ||
const url = new URL(`${localhost}/FITple/profile/likes`); | ||
if (category) url.searchParams.append("category", category); | ||
const response = await fetch(url, { | ||
method: "GET", | ||
credentials: "include", | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`서버 오류: ${response.status}`); | ||
} | ||
|
||
return await response.json(); | ||
} catch (error) { | ||
console.error("검색 요청 중 오류가 발생했습니다.", error); | ||
throw new 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const RecomFeedApi = async () => { | ||
try { | ||
const response = await fetch('/TestData/ItemTestData.json', { | ||
method: 'GET', | ||
credentials: 'include', | ||
}); | ||
|
||
// 응답 상태가 정상인지 확인 | ||
if (!response.ok) { | ||
throw new Error(`Network response was not ok: ${response.statusText}`); | ||
} | ||
|
||
const data = await response.json(); | ||
return data; // 필요에 따라 데이터를 반환합니다. | ||
} catch (error) { | ||
console.error('There has been a problem with your fetch operation:', error); | ||
return null; // 오류 발생 시 null 반환 | ||
} | ||
}; | ||
|
||
export default RecomFeedApi; // default 내보내기 | ||
|
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,44 @@ | ||
// const localhost = "http://localhost:3000"; | ||
|
||
// export const ClothApi = async (category, cursorId, size) => { | ||
// try { | ||
// const url = new URL(`${localhost}/FITple/my/closet/main`); | ||
|
||
// // 쿼리 파라미터 추가 | ||
// if (category !== undefined) url.searchParams.append("category", category); | ||
// if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId); | ||
// if (size !== undefined) url.searchParams.append("size", size); | ||
|
||
// const response = await fetch(url, { | ||
// method: "GET", | ||
// credentials: "include", | ||
// }); | ||
|
||
// if (!response.ok) { | ||
// throw new Error(`서버 오류: ${response.status}`); | ||
// } | ||
// const data = await response.json() | ||
// return data; | ||
// } catch (error) { | ||
// console.error("검색 요청 중 오류가 발생했습니다.", error); | ||
// throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요."); | ||
// } | ||
// }; | ||
|
||
export const RecomMainApi = async () => { | ||
try { | ||
const response = await fetch('/TestData/UserTestData.json', { // JSON 파일의 경로를 설정합니다. | ||
method: 'GET', | ||
credentials: 'include', // 쿠키를 포함하여 요청합니다. | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
|
||
const data = await response.json(); // 응답을 JSON으로 변환합니다. | ||
return data; // 필요에 따라 데이터를 반환합니다. | ||
} catch (error) { | ||
console.error('There has been a problem with your fetch operation:', 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const localhost = "http://localhost:3000"; | ||
|
||
const TestApi = async (category, cursorId, size) => { | ||
try { | ||
const url = new URL(`${localhost}/FITple/my/closet/main`); | ||
|
||
// 쿼리 파라미터 추가 | ||
if (category !== undefined) url.searchParams.append("category", category); | ||
if (cursorId !== undefined) url.searchParams.append("cursorId", cursorId); | ||
if (size !== undefined) url.searchParams.append("size", size); | ||
|
||
const response = await fetch(url, { | ||
method: "GET", | ||
credentials: "include", | ||
}); | ||
|
||
if (!response.ok) { | ||
throw new Error(`서버 오류: ${response.status}`); | ||
} | ||
const data = await response.json(); | ||
return data; | ||
} catch (error) { | ||
console.error("검색 요청 중 오류가 발생했습니다.", error); | ||
throw new Error("네트워크 오류가 발생했습니다. 잠시 후 다시 시도해주세요."); | ||
} | ||
}; | ||
|
||
export default TestApi |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { create } from 'zustand'; | ||
|
||
const useAuthStore = create((set) => ({ | ||
token: null, | ||
setToken: (newToken) => set({ token: newToken }), | ||
clearToken: () => set({ token: null }), | ||
})); | ||
|
||
export default useAuthStore; |
Oops, something went wrong.