Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kan 71] 마이프로필, 내정보수정 화면 & 로직 구현 #17

Merged
merged 7 commits into from
May 27, 2024

Conversation

jhpark223
Copy link
Collaborator

@jhpark223 jhpark223 commented May 26, 2024

마이프로필(마이페이지) 화면
-유저 정보 조회(닉네임)
-찜한 가게 조회
-작성한 리뷰 조회
-닉네임 클릭시 화면 이동

내정보수정 화면
-닉네임 중복확인
-닉네임 수정하기
-로그아웃
-회원탈퇴

+로그인시 userId 저장

Copy link
Collaborator

@sjsjmine129 sjsjmine129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sinkyoungdeok sinkyoungdeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 48 to 99
const fetchMyReviews = async () => {
try {
const response = await axios.get(
`${API_URL}/v1/restaurants/my-reviews`,
{
headers: { Authorization: `Bearer ${context.accessToken}` },
}
);

console.log('My Review API Response:', response.data);

const reviews = response.data.reviews ? response.data.reviews.map(review => ({
id: review.id,
image: review.imageUrls[0],
score: review.rating,
reviewCount: review.viewCount,
heartCount: review.likeCount,
firstReview: {
reviewer: review.username,
body: review.content,
},
})) : [];

setMyReviews(reviews);
} catch (error) {
console.error("Failed to fetch reviews:", error);
} finally {
setLoading(false);
}
};

const fetchLikedStores = async () => {
try {
const response = await axios.get(
`${API_URL}/v1/restaurants/my-like`,
{
headers: { Authorization: `Bearer ${context.accessToken}` },
}
);

console.log('Liked Stores API Response:', response.data);

const stores = response.data.restaurants ? response.data.restaurants.map(store => ({
name: store.name,
image: store.representativeImageUrl,
})) : [];

setMyStoresData(stores);
} catch (error) {
console.error("Failed to fetch liked stores:", error);
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

무한 스크롤 없어도 될까여?
기본은 아마 size 20으로만 호출할거라서. 그뒤는 안보일 것 같아영

@sjsjmine129
Copy link
Collaborator

충돌났길래 수정했습니다.

color.js에 새로 추가 된게 있는 간단한 부분이라 신경안쓰셔도 될거 같습니다!

@jhpark223
Copy link
Collaborator Author

충돌났길래 수정했습니다.

color.js에 새로 추가 된게 있는 간단한 부분이라 신경안쓰셔도 될거 같습니다!

감사합니다!

@jhpark223 jhpark223 merged commit 28832ad into main May 27, 2024
1 check passed
@jhpark223 jhpark223 deleted the KAN-71 branch May 27, 2024 03:17
const fetchMyReviews = async (page) => {
try {
const response = await axios.get(
`${API_URL}/v1/restaurants/my-reviews?page=${page}&size=5`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 5개씩은 너무 자주호출될 것 같아서, 20개로 바꾸는건 어떨까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants