diff --git a/client/src/hooks/queries/useRequestPutBillAction.ts b/client/src/hooks/queries/useRequestPutBillAction.ts index f2bfe8781..a58da8ea4 100644 --- a/client/src/hooks/queries/useRequestPutBillAction.ts +++ b/client/src/hooks/queries/useRequestPutBillAction.ts @@ -10,7 +10,6 @@ interface PutBillActionMutationProps { actionId: number; title: string; price: number; - onSuccessCallback?: () => void; // 콜백 함수 타입을 정의 } const useRequestPutBillAction = () => { @@ -18,18 +17,11 @@ const useRequestPutBillAction = () => { const queryClient = useQueryClient(); return useMutation({ - mutationFn: async ({actionId, title, price}: PutBillActionMutationProps) => { - const response = await requestPutBillAction({eventId, actionId, title, price}); - return response; // response를 반환하여 onSuccess에서 접근할 수 있게 함 - }, - onSuccess: (data, variables) => { + mutationFn: ({actionId, title, price}: PutBillActionMutationProps) => + requestPutBillAction({eventId, actionId, title, price}), + onSuccess: () => { queryClient.invalidateQueries({queryKey: [QUERY_KEYS.stepList]}); queryClient.invalidateQueries({queryKey: [QUERY_KEYS.memberReport]}); - - // 콜백 함수가 전달되었다면 실행 - if (variables.onSuccessCallback) { - variables.onSuccessCallback(); - } }, }); };