-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/screens/mypage/MypageScreen.js
Outdated
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); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
무한 스크롤 없어도 될까여?
기본은 아마 size 20으로만 호출할거라서. 그뒤는 안보일 것 같아영
충돌났길래 수정했습니다. color.js에 새로 추가 된게 있는 간단한 부분이라 신경안쓰셔도 될거 같습니다! |
감사합니다! |
const fetchMyReviews = async (page) => { | ||
try { | ||
const response = await axios.get( | ||
`${API_URL}/v1/restaurants/my-reviews?page=${page}&size=5`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 5개씩은 너무 자주호출될 것 같아서, 20개로 바꾸는건 어떨까요?
마이프로필(마이페이지) 화면
-유저 정보 조회(닉네임)
-찜한 가게 조회
-작성한 리뷰 조회
-닉네임 클릭시 화면 이동
내정보수정 화면
-닉네임 중복확인
-닉네임 수정하기
-로그아웃
-회원탈퇴
+로그인시 userId 저장