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

[FEAT] 내 투표 조회 및 삭제 기능 #197

Merged
merged 11 commits into from
Mar 11, 2024
Merged

[FEAT] 내 투표 조회 및 삭제 기능 #197

merged 11 commits into from
Mar 11, 2024

Conversation

jhsung23
Copy link
Collaborator

@jhsung23 jhsung23 commented Mar 10, 2024

✨ 작업 내용

  • 내 투표 조회 쿼리
    • 자주 업데이트되는 데이터가 아니라서 stale/gc 시간 Inifnity 설정
    • 투표 등록이나 삭제 시 쿼리 만료
  • 내 투표 삭제 뮤테이션
    • 마이페이지, 투표 상세 페이지에서 삭제 가능
    • 투표에서 더보기 버튼 클릭 시 확인용 알럿 노출
    • 확인 클릭 시 투표 글 삭제
    • 삭제 중일 때는 삭제 버튼 disabled 처리

📚 작업 결과

마이페이지 - 내 투표 조회

스크린샷 2024-03-10 오전 10 49 18

마이페이지 - 내 투표 삭제

Mar-10-2024 10-48-56

close #194

🙏 기타 참고 사항

✅ PR 등록 전 확인 후 체크해 주세요! (x 표시 해 주세요.)

  • Assignees를 지정했습니다. (해당 PR 작업한 사람을 태그해 주세요)
  • Labels, Milestone을 등록했습니다.
  • Development에 PR 내용과 연결된 Issue를 등록했습니다.

@jhsung23 jhsung23 added the ✨ Feature 기능 개발 label Mar 10, 2024
@jhsung23 jhsung23 self-assigned this Mar 10, 2024
@jhsung23 jhsung23 requested a review from CodyMan0 as a code owner March 10, 2024 01:51
Copy link

Copy link

Copy link
Collaborator

@CodyMan0 CodyMan0 left a comment

Choose a reason for hiding this comment

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

확인했습니다. 수고하셨어요!

@@ -12,7 +12,7 @@ const getMyVote = async () => {
const useGetMyVote = () => {
return useQuery({
queryFn: getMyVote,
queryKey: ['my-vote'],
queryKey: ['votes', 'mine'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

검색 기능 구현에서 쿼리 키를 [votes, keyword]로 설정했습니다. 그럴일 없겠지만 만약 유저가 mine이라는 키워드를 쳤을때는 동일한 쿼리키가 설정되는 것 같아요!!

스크린샷 2024-03-10 오후 11 21 19

Copy link
Collaborator Author

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]로 변경하면 좋을 것 같은데 어떠신가요? ㅎㅎ

Copy link
Collaborator

Choose a reason for hiding this comment

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

계층적으로 사용하면 좋을 것 같아요! 네네 수정하면 좋을 것 같아요!! 검색 쪽 [search-vote , keyword] 로 수정할게요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵ㅎㅎ 추가로 검색 쿼리 쪽에 enabled 옵션 사용하면 좋을 것 같습니다!

@jhsung23 jhsung23 merged commit a7dbc61 into main Mar 11, 2024
4 checks passed
@jhsung23 jhsung23 deleted the feat/#194-my-vote branch March 11, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 내 투표 조회 기능
2 participants