-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FEAT] 내 투표 조회 및 삭제 기능 #197
Conversation
0bbf1d9
to
3d89963
Compare
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.
확인했습니다. 수고하셨어요!
src/hooks/auth/useGetMyVote.ts
Outdated
@@ -12,7 +12,7 @@ const getMyVote = async () => { | |||
const useGetMyVote = () => { | |||
return useQuery({ | |||
queryFn: getMyVote, | |||
queryKey: ['my-vote'], | |||
queryKey: ['votes', 'mine'], |
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.
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.
아 쿼리키가 겹치겠네요.
혹시 검색 쪽 쿼리키의 votes를 다른 것으로 변경하는게 어떨까요? 보니까 쿼리키를 계층적으로 사용해야한다고 하더라구요.
내 투표 조회 쿼리
와 전체 투표 조회 쿼리
같이 서로 연관있는 쿼리의 키를 일치시키고, 내 투표 조회 쿼리
와 전체 투표 조회 쿼리
를 만료시킬 때 함께 만료될 필요가 없는 (ex. 검색 쿼리, 투표 상세 쿼리) 쿼리들은 키를 다르게 가져가야할 것 같아요.
제가 투표 상세를 [vote, voteId]
로 설정해두었는데 헷갈리지 않도록 검색은 [search-vote, keyword]
, 투표 상세는 [vote-detail, voteId]
로 변경하면 좋을 것 같은데 어떠신가요? ㅎㅎ
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.
계층적으로 사용하면 좋을 것 같아요! 네네 수정하면 좋을 것 같아요!! 검색 쪽 [search-vote , keyword] 로 수정할게요!
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.
넵ㅎㅎ 추가로 검색 쿼리 쪽에 enabled 옵션 사용하면 좋을 것 같습니다!
✨ 작업 내용
📚 작업 결과
마이페이지 - 내 투표 조회
마이페이지 - 내 투표 삭제
close #194
🙏 기타 참고 사항
✅ PR 등록 전 확인 후 체크해 주세요! (x 표시 해 주세요.)