aboutsummaryrefslogtreecommitdiff
path: root/src/components/hooks/queries/useDeleteQuery.ts
blob: 556231a9a513a04b105e2e41a2b508245ecd26fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { useApi } from '../useApi';
import { useModified } from '../useModified';

export function useDeleteQuery(path: string, params?: Record<string, any>) {
  const { del, useMutation } = useApi();
  const query = useMutation({
    mutationFn: () => del(path, params),
  });
  const { touch } = useModified();

  return { ...query, touch };
}