Feat: 모임 참여에 성공하면 DB 테이블에 사용자 정보가 입력되는 기능 구현#93
Merged
myeongheonhong merged 3 commits intodevelopfrom Jun 9, 2025
Merged
Conversation
✅ Deploy Preview for we-write ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
myeongheonhong
approved these changes
Jun 9, 2025
| const useParticipateCollaborator = ({ | ||
| socialId, | ||
| }: useParticipateCollaboratorParams) => { | ||
| const queryClient = useQueryClient(); |
Contributor
There was a problem hiding this comment.
queryClietn를 가져올때 getQueryClient로 가져와도 좋을거 같습니다!
Collaborator
Author
There was a problem hiding this comment.
getQueryClient.ts 에서 선언한 함수 말씀하신걸까요?
맞다면 getQueryClient.ts는 서버 컴포넌트 환경에서 QueryClient를 생성하는 함수이고,
useQueryClient()는 QueryProviders에서 제공한 context로 부터 client를 가져오는 훅이라서
역할이 다른 것으로 알고 있습니다!
저도 정리하려니깐 헷갈리네요..! 혹시 제가 잘못 알고 있는 부분이 있다면 지적부탁드립니다
hoxey2Front
approved these changes
Jun 9, 2025
This file contains hidden or 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
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.
PR요약
PR 타입(하나 이상의 PR 타입을 선택해주세요)
변경 사항
"모임 참여하기" 버튼을 클릭하면 달램API 모임 참가 요청과 함께, DB
stroy_collaborators테이블에 사용자 정보가 등록되는기능을 구현하였습니다.
useMatation커스텀 훅을 사용하여, 호출 성공 시에SOCIAL_PARTICIPANTSkey를 가진 API 데이터를 refetch하도록 하였습니다.특이 사항이라면 명헌님께서 만들어주신
createCollaborator함수의 매개변수를data,role2개의 인자를 받는 기존 방식에서하나의 객체를 받는 방식으로 변경하였습니다.
이유는
React Query의 설계상 제한으로 인해,useMutation은mutationFn이 단일 인자만 받도록 강제하기 때문입니다.즉 아래와 같이 인자를 전달하면 에러가 발생합니다.
매개변수의 변경으로 기존에
createCollaborator를 호출하던 명헌님의 코드(useCreateSocialForm.ts)도 하나의 객체로 묶어 값을 전달하도록 변경하였습니다.