use-post-edit-fixer.tsx 592 B

1234567891011121314151617
  1. import { useMutation } from '@tanstack/react-query';
  2. import { fixersQueryKeys } from '../fixers-query-keys';
  3. import { type PostEditFixer, fixersApi } from '../fixers-api';
  4. import type { BaseAxiosError } from '../../../../types';
  5. import { ResponseType } from '@api/response-type';
  6. export const usePostEditFixerMutation = () => {
  7. return useMutation<ResponseType, BaseAxiosError, PostEditFixer, ResponseType>({
  8. mutationKey: fixersQueryKeys.editFixer(),
  9. mutationFn: async (data) => {
  10. const response = await fixersApi.editFixer(data);
  11. return response.data;
  12. }
  13. });
  14. };