-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#68: 메인화면 리스트 api 연결 #75
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
base: develop
Are you sure you want to change the base?
The head ref may contain hidden characters: "feat/68-\uBA54\uC778\uD654\uBA74-\uB9AC\uC2A4\uD2B8-API-\uC5F0\uACB0"
Conversation
- 화면 표시에 필요한 필수 필드 검증 로직 추가 - participantStatus, distance, distanceKm, timeAgo 등 검증 - category 유효값 검증 (ALL, DELIVERY, GROCERY, HOUSEHOLD) - API 응답 데이터 유효성 검사 함수 추가 - 에러 발생 시 빈 데이터 반환으로 앱 크래시 방지 - 쿼리 업데이트 시마다 자동 유효성 검사 수행
DandelionQZ
left a comment
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.
카테고리 선택과 관련된 로직을 훅으로 관리하는 방법이 인상깊었습니다! 저는 이런경우 zustand store를 생성해서 전역으로 선택된 카테고리 값과 카테고리 변경 함수를 다뤘었거든요. props로 선택된 카테고리와 카테고리 변경 함수를 props로 넘겨줘야하지만 이렇게 훅으로 작성하는 방법도 있구나하고 새롭게 알고갑니다!! 수고하셨어요 ~!
| interface PartyListProps { | ||
| data: PartyListResponse | undefined; | ||
| isLoading?: boolean; | ||
| onCardPress?: (partyId: number) => void; | ||
| } |
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.
값을 props로 받지 않고 PartyList 컴포넌트 내부에서 자체적으로 호출하는 건 어떤가요? 역할이 분리되어서 부모 컴포넌트가 많은 역할을 맡게되지 않아도 될거 같아서요!
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.
isValidPartyItem와 isValidPartyListResponse를 구현하게 된 이유가 궁금합니다!
⚙️ Related ISSUE Number
#68
📄 Work Description
1.
api/urls.tsGET_PARTIES: "/api/parties")2.
api/partyApi.tsgetPartyList: 파티 리스트 조회 API 호출isValidPartyItem: 파티 아이템 필수 필드 검증isValidPartyListResponse: API 응답 데이터 구조 검증3.
hooks/usePartyList.tsuseQuery로 파티 리스트 데이터 조회partyType,setPartyType)enabled옵션)4.
app/(tabs)/index.tsxuseUserCoords)usePartyList)MainCategory)PartyList)5.
components/main/MainCard.tsximageError상태로 이미지 로딩 실패 감지rgba(0, 0, 0, 0.4))blurRadius: 2)6.
components/main/MainCategory.tsxonCategoryChange)7.
components/main/PartyList.tsx8.
types/party.tsPartyCategory: 파티 카테고리 타입 (ALL, DELIVERY, GROCERY, HOUSEHOLD)PartyListParams: 파티 리스트 조회 파라미터PartyItem: 파티 아이템 데이터 구조PartyListResponse: API 응답 데이터 구조9.
components/main/MainHeader.tsxuseAuthStore를 사용하여 사용자 정보 가져오기🔑 주요 개선 사항
데이터 유효성 검사
에러 처리 강화
이미지 에러 처리
로딩 상태 관리
마감 파티 시각적 처리
📷 Screenshot
(백에서 ALL 카테고리로 하나를 넣어주셔서,,,
일단 공지 아이콘으로 기본이미지 넣어놓긴 했는데, 추후에 삭제해도 좋을 것 같습니다)
2025-12-31.4.36.02.mov
💬 To Reviewers
지금은 useQuery로 한번에 데이터를 불러오는데 추후에
useInfiniteQuery로 변경하는 작업이 필요할 것 같습니다!