mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Converted mutation queries.
This commit is contained in:
parent
3f167e05ba
commit
0f9669f886
34 changed files with 259 additions and 350 deletions
|
|
@ -4,11 +4,11 @@ import { useToast } from '@umami/react-zen';
|
|||
|
||||
export function useUpdateQuery(path: string, params?: Record<string, any>) {
|
||||
const { post, useMutation } = useApi();
|
||||
const { mutate, isPending, error } = useMutation({
|
||||
const query = useMutation({
|
||||
mutationFn: (data: Record<string, any>) => post(path, { ...data, ...params }),
|
||||
});
|
||||
const { touch } = useModified();
|
||||
const { toast } = useToast();
|
||||
|
||||
return { mutate, isPending, error, touch, toast };
|
||||
return { ...query, touch, toast };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue