-
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.
feat: [#100] 프로필페이지 좋아하는 옷, 관심있는 옷 API 구현
- Loading branch information
1 parent
acb5ba8
commit 83b5f93
Showing
9 changed files
with
207 additions
and
64 deletions.
There are no files selected for viewing
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 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
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
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