diff --git a/apps/member/src/hooks/queries/application/useApplicationAllMemberMutation.ts b/apps/member/src/hooks/queries/application/useApplicationAllMemberMutation.ts index b2dc35c1..dcf518d9 100644 --- a/apps/member/src/hooks/queries/application/useApplicationAllMemberMutation.ts +++ b/apps/member/src/hooks/queries/application/useApplicationAllMemberMutation.ts @@ -1,30 +1,22 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import { postApplicationAllMember } from '@api/application'; -import { MEMBER_QUERY_KEY } from '@constants/key'; import useToast from '@hooks/common/useToast'; /** * 모집 내 합격자 계정 일괄 생성 */ export function useApplicationAllMemberMutation() { - const queryClient = useQueryClient(); const toast = useToast(); const mutation = useMutation({ mutationFn: postApplicationAllMember, - onSuccess: (data) => { + onSuccess: () => { toast({ state: 'success', message: '멤버 일괄 생성이 완료되었어요.\n불합격 상태인 지원자의 계정이 생성되지 않아요.', }); - - const queryKeys = data.map((member) => MEMBER_QUERY_KEY.MEMBER(member)); - - queryKeys.forEach((queryKey) => { - queryClient.invalidateQueries({ queryKey }); - }); }, }); diff --git a/apps/member/src/hooks/queries/application/useApplicationMemberMutation.ts b/apps/member/src/hooks/queries/application/useApplicationMemberMutation.ts index c40bdc96..bb6534d9 100644 --- a/apps/member/src/hooks/queries/application/useApplicationMemberMutation.ts +++ b/apps/member/src/hooks/queries/application/useApplicationMemberMutation.ts @@ -1,14 +1,12 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import { postApplicationMember } from '@api/application'; -import { MEMBER_QUERY_KEY } from '@constants/key'; import useToast from '@hooks/common/useToast'; /** * 합격자 멤버 단일 생성 */ export function useApplicationMemberMutation() { - const queryClient = useQueryClient(); const toast = useToast(); const mutation = useMutation({ @@ -24,9 +22,6 @@ export function useApplicationMemberMutation() { state: 'success', message: '멤버 생성이 완료되었습니다.', }); - queryClient.invalidateQueries({ - queryKey: MEMBER_QUERY_KEY.MEMBER(data), - }); }, });