Skip to content

[FEAT] 이번주 인기 스테이 불러오기 api 연결 #132

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

Merged
merged 7 commits into from
Jan 23, 2025

Conversation

maylh
Copy link
Collaborator

@maylh maylh commented Jan 21, 2025

🛰️ 관련 이슈

해결한 이슈 번호를 작성해주세요
close #129

🧑‍💻 작업 내용

작업한 내용을 간략히 작성해주세요

  • 이번주 인기 스테이 불러오기 api 연결했습니다

🗯️ PR 포인트

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

  • 필드값에 오류가 있어서 스크린샷 상에서 사진이 안 보이는게 맞습니다. imgUrl 필드에서 템플스테이 이미지의 url이 아닌 템플스테이의 url이 반환되고 있기 때문인데, 해당 부분은 서버측에 수정 요청 드린 상태라 반영 되면 정상적으로 사진이 보일 것 같습니다 (네트워크 탭에서 데이터 제대로 오는 것 확인했습니당 ~)
  • 캐러셀 위치가 요상한건 아직 메인페이지 디벨롭에 머지되기 전에 브랜치 파서 작업한거라 컴포넌트를 빈 페이지에 불러와서 테스트하느라 그래요 호호호

🚀 알게된 점

기록하며 개발하기!

  • 매개변수 타입 지정을 정확히 해주자 . !!!!!!!!!!

📖 참고 자료 (선택)

참고했던 문서들 공유하기!

📸 스크린샷 (선택)

스크린샷 2025-01-21 오후 8 10 13

Copy link

github-actions bot commented Jan 21, 2025

🪷 Storybook 확인 🪷
🔗 https://677fa9af1269762b7858c29f-qrffqwlvdg.chromatic.com/

const PopularCarousel = () => {
const userId = localStorage.getItem('userId');
Copy link
Collaborator

Choose a reason for hiding this comment

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

현재 userId가 string으로 사용되고 있는데, 서버에서 Long으로 선언되어있으므로 Number로 반환하면 좋을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정했습니다 ! 08f73b5


if (isError) {
return <p>Error</p>;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

구현되어있는 로딩페이지와 에러페이지를 띄우도록 하면 좋을 것 같아요


const useGetRanking = (userId: string | null) => {
const { data, isLoading, isError } = useQuery<RankingResponse>({
queryKey: ['rankiing', userId],
Copy link
Collaborator

Choose a reason for hiding this comment

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

오타 ranking으로 바꿔주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@Taew00k Taew00k left a comment

Choose a reason for hiding this comment

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

첫 API 연결!! 고생하셨습니다

Copy link
Collaborator

@bykbyk0401 bykbyk0401 left a comment

Choose a reason for hiding this comment

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

첫 api 연결!!! 수고하셨습니당

Copy link
Member

@seong-hui seong-hui left a comment

Choose a reason for hiding this comment

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

멋져용 리뷰에 남긴 부분은 추후에 수정하면 좋을 것 같습니다!! 고생하셨어요!!

import { privateInstance } from '@apis/instance';

const getRanking = async (userId: number | null) => {
const res = await privateInstance.get('/ranking', {
Copy link
Member

@seong-hui seong-hui Jan 23, 2025

Choose a reason for hiding this comment

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

현재 privateInstance로 연결하고 있는데 해당 인기스테이에서 로그인하지 않은 사용자도 불러올 수 있으니 해당 부분 추후에 수정이 필요할 것으로 보입니다.

@seong-hui seong-hui merged commit c0d8f6b into develop Jan 23, 2025
5 checks passed
@seong-hui seong-hui deleted the feat/#129/api-get-ranking branch January 23, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 이번주 인기 스테이 리스트 반환 api 연결
4 participants