Skip to content

Commit

Permalink
fix: custom 되면 질문 리스트 invalidate 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ooherin committed Oct 24, 2024
1 parent 9400525 commit 6584fbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/hooks/query/usePutCustomChecklist.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';

import { putCustomChecklist } from '@/apis/checklist';
import { QUERY_KEYS } from '@/constants/queryKeys';

const usePutCustomChecklist = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (questionIds: number[]) => putCustomChecklist({ questionIds }),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.CHECKLIST_QUESTIONS] });
},
});
};

Expand Down

0 comments on commit 6584fbd

Please sign in to comment.