-
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.
Browse files
Browse the repository at this point in the history
Feat/#100 프로필 정보 API 연결
- Loading branch information
Showing
13 changed files
with
584 additions
and
65 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 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
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
16 changes: 15 additions & 1 deletion
16
FITple-Frontend/src/components/ProfileMyBody/ProfileMyBody.jsx
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
86 changes: 86 additions & 0 deletions
86
FITple-Frontend/src/components/UserInfoBody2/UserInfoBody2.jsx
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,86 @@ | ||
import React from "react"; | ||
import { | ||
MainText, | ||
InfoContainer, | ||
BodyInfoContainer, | ||
InputSet, | ||
SubText, | ||
BodyInputWrapper, | ||
BodyInputBox, | ||
UnitText, | ||
MainBox, | ||
EditBTN, | ||
} from "./UserInfoBody2.style"; | ||
|
||
const UserInfoBody2 = ({ ...props }) => { | ||
return ( | ||
<InfoContainer {...props}> | ||
{/* 컴포넌트 작업을 위해서 div하나 추가 */} | ||
<MainBox {...props}> | ||
<MainText>체형 정보</MainText> | ||
<EditBTN {...props}>수정</EditBTN> | ||
</MainBox> | ||
|
||
<BodyInfoContainer> | ||
<InputSet> | ||
<SubText>키</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.height}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>몸무게</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.weight}</BodyInputBox> | ||
<UnitText>kg</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>어깨 너비</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.shoulder_width}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>가슴둘레</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.chest_circumference}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>팔 길이</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.arm_length}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>허리 둘레</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.waist_circumference}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>허벅지 둘레</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.thigh_circumference}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
<InputSet> | ||
<SubText>엉덩이 둘레</SubText> | ||
<BodyInputWrapper> | ||
<BodyInputBox>{props.data.hip_circumference}</BodyInputBox> | ||
<UnitText>cm</UnitText> | ||
</BodyInputWrapper> | ||
</InputSet> | ||
</BodyInfoContainer> | ||
</InfoContainer> | ||
); | ||
}; | ||
|
||
export default UserInfoBody2; |
Oops, something went wrong.