-
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
[FE] 컴포넌트에서 직접 호출하는 useQuery를 커스텀 훅으로 분리 #376
Merged
surpise
merged 20 commits into
boostcampwm2023:develop
from
surpise:fe/refactor/react-query-hooks
Jan 18, 2024
Merged
[FE] 컴포넌트에서 직접 호출하는 useQuery를 커스텀 훅으로 분리 #376
surpise
merged 20 commits into
boostcampwm2023:develop
from
surpise:fe/refactor/react-query-hooks
Jan 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
쿼리 키로 사용하던 문자열들을 상수로 분리
쿼리 키로 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 삭제
gimewn
approved these changes
Jan 17, 2024
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.
반복되는 코드가 많이 줄어들었네요! 고생하셨습니다 👍
gimewn
reviewed
Jan 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
이슈 번호
#373
완료한 기능 명세