Refactor/chat message#93
Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on refactoring API imports, optimizing MyPage caching behavior, and adjusting festival image sizing. The main changes consolidate the ApiErrorResponse type definition and introduce consistent default pagination constants across the codebase.
Changes:
- Moved
ApiErrorResponsetype fromapiInstance.tstoapiResponse.tsand updated all imports - Introduced
DEFAULT_PAGEandDEFAULT_SIZEconstants in pagination-related API functions - Updated MyPage cache settings to reduce unnecessary re-renders by adding
refetchOnMount: falseandrefetchOnWindowFocus: false - Added
aspect-[4/5]class to festival card images in MyPage - Simplified conditional logic in
useChatRoomhook for message initialization
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/apis/apiInstance.ts | Removed duplicate ApiErrorResponse interface definition |
| src/apis/apiResponse.ts | Removed obsolete comment from ApiErrorResponse interface |
| src/apis/*/*.ts (multiple files) | Updated imports to use ApiErrorResponse from apiResponse.ts and consolidated import statements |
| src/apis/search/searchFestivals.ts | Replaced inline default values with DEFAULT_PAGE and DEFAULT_SIZE constants, fixed typo in variable names |
| src/apis/festivals/getMyFestivals.ts | Introduced DEFAULT_PAGE and DEFAULT_SIZE constants for pagination |
| src/apis/review/getMyReviews.ts | Introduced DEFAULT_PAGE and DEFAULT_SIZE constants for pagination |
| src/apis/review/getMyReviewFestivals.ts | Introduced DEFAULT_PAGE and DEFAULT_SIZE constants for pagination |
| src/apis/wish/getMyWishFestivals.ts | Introduced DEFAULT_PAGE and DEFAULT_SIZE constants for pagination |
| src/apis/chat/getMyChats.ts | Introduced DEFAULT_PAGE and DEFAULT_SIZE constants for pagination |
| src/apis/review/getSingleReview.ts | Updated import path to use absolute path for Review type |
| src/pages/My/components/MyPageWishFestivalsSection.tsx | Replaced staleTime: 0, gcTime: 0 with refetchOnMount: false, refetchOnWindowFocus: false |
| src/pages/My/components/MyPageReviewFestivalsSection.tsx | Added refetchOnMount: false, refetchOnWindowFocus: false while keeping existing cache settings |
| src/pages/My/components/MyPageFestivalCard.tsx | Added aspect-[4/5] class to festival poster image |
| src/hooks/useChatRoom.ts | Refactored message initialization logic to use ternary operator |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/apis/search/searchFestivals.ts:1
- The function signature is missing the
ApiErrorResponsetype parameter for error handling consistency. AddApiErrorResponseas the second generic parameter to match other API functions in the codebase.
import { apiInstance } from '@/apis/apiInstance';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
skybluesharkk
left a comment
There was a problem hiding this comment.
변경하신 부분들 모두 확인하였습니다
고생하셨어요!
| export const getMyReviews = async ( | ||
| page = 0, | ||
| size = 5, | ||
| page = DEFAULT_PAGE, |
| src={data.posterInfo} | ||
| alt={`${data.title} 축제 이미지`} | ||
| className="h-full object-cover" | ||
| className="h-full aspect-[4/5] object-cover" |
8b55f21
into
kakao-tech-campus-3rd-step3:develop
마이페이지 좋아요한 축제 이미지 사이즈 조정
관련 이슈 : close: 마이페이지 좋아요한 축제 이미지 비율 버그 #91
api 기본 변수 상수로 분리
마이페이지 캐시 조건 완화로 불필요한 리렌더링 방지