mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 21:15:35 +01:00
Converted mutation queries.
This commit is contained in:
parent
3f167e05ba
commit
0f9669f886
34 changed files with 259 additions and 350 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { TypeConfirmationForm } from '@/components/common/TypeConfirmationForm';
|
||||
import { useApi, useMessages } from '@/components/hooks';
|
||||
import { useDeleteQuery, useMessages } from '@/components/hooks';
|
||||
|
||||
const CONFIRM_VALUE = 'DELETE';
|
||||
|
||||
|
|
@ -13,14 +13,12 @@ export function TeamDeleteForm({
|
|||
onClose?: () => void;
|
||||
}) {
|
||||
const { labels, formatMessage } = useMessages();
|
||||
const { del, useMutation } = useApi();
|
||||
const { mutate, error, isPending } = useMutation({
|
||||
mutationFn: () => del(`/teams/${teamId}`),
|
||||
});
|
||||
const { mutate, error, isPending, touch } = useDeleteQuery(`/teams/${teamId}`);
|
||||
|
||||
const handleConfirm = async () => {
|
||||
mutate(null, {
|
||||
onSuccess: async () => {
|
||||
touch('teams');
|
||||
onSave?.();
|
||||
onClose?.();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue