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

[FE] 컴포넌트에서 직접 호출하는 useQuery를 커스텀 훅으로 분리 #376

Merged
merged 20 commits into from
Jan 18, 2024

Conversation

surpise
Copy link
Collaborator

@surpise surpise commented Jan 17, 2024

이슈 번호

#373

완료한 기능 명세

  • 컴포넌트에서 직접 호출하는 useQuery를 커스텀 훅으로 분리

쿼리 키로 사용하던 문자열들을 상수로 분리
쿼리 키로 diary를 사용하는 useQuery를 useDiaryQuery 커스텀 훅으로 분리
쿼리 키로 grass를 사용하는 useQuery를 커스텀 훅으로 분리
emotionStat을 쿼리 키로 사용하는 useQuery 커스텀 훅을 추가
dayDiaryList를 받아오는 useQuery를 커스텀 훅으로 분리
myDayDiaryList를 받아오는 커스텀 훅 추가
useDayDiaryList와 쿼리 키를 제외하고 같기 때문에 추후 수정할 예정
feedDiaryList를 가져오는 useQuery를 커스텀 훅으로 분리
profileData를 가져오는 커스텀 훅 생성
searchDataList를 가져오는 useQuery를 커스텀 훅으로 분리
reactionList를 받아오는 useQuery를 커스텀 훅으로 분리
friendList를 받아오는 useQuery를 커스텀 훅으로 분리
friend sendList를 받아오는 useQuery를 커스텀 훅 분리
receivedList useQuery를 커스텀 훅으로 분리
sendList와 형태가 같으므로 추후 수정 필요
monthDiaryData를 받아오는 useQuery 커스텀 훅 분리
myWeekDiary를 받아오는 useQuery를 커스텀 훅으로 분리
컴포넌트에서 직접 useQuery를 사용하던 것을 분리한 커스텀 훅을 불러와
사용하는 것으로 변경
쿼리 키를 제외하고 같은 코드를 가지고 있기 때문에
쿼리 키를 입력으로 받고 두 커스텀 훅을 합침
사용하지 않는 import 삭제
@surpise surpise added enhancement 개선 또는 피드백 반영 FE 🎨 FrontEnd labels Jan 17, 2024
@surpise surpise requested review from dohun2 and gimewn January 17, 2024 06:29
@surpise surpise self-assigned this Jan 17, 2024
Copy link
Collaborator

@gimewn gimewn left a comment

Choose a reason for hiding this comment

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

반복되는 코드가 많이 줄어들었네요! 고생하셨습니다 👍

@surpise surpise merged commit 7b424fc into boostcampwm2023:develop Jan 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 개선 또는 피드백 반영 FE 🎨 FrontEnd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants