umami/src/components/hooks/queries/useDeleteQuery.ts
2025-05-31 02:11:18 -07:00

11 lines
364 B
TypeScript

import { useApi, useModified } from '@/components/hooks';
export function useDeleteQuery(path: string, params?: { [key: string]: any }) {
const { del, useMutation } = useApi();
const { mutate, isPending, error } = useMutation({
mutationFn: () => del(path, params),
});
const { touch } = useModified();
return { mutate, isPending, error, touch };
}