mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Convert useModified into a real hook.
This commit is contained in:
parent
a426c242cb
commit
91e3dff7f5
24 changed files with 63 additions and 48 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||
import ConfirmationForm from 'components/common/ConfirmationForm';
|
||||
import { touch } from 'store/modified';
|
||||
|
||||
export function UserDeleteForm({ userId, username, onSave, onClose }) {
|
||||
const { FormattedMessage, messages, labels, formatMessage } = useMessages();
|
||||
const { del, useMutation } = useApi();
|
||||
const { mutate, error, isPending } = useMutation({ mutationFn: () => del(`/users/${userId}`) });
|
||||
const { touch } = useModified();
|
||||
|
||||
const handleConfirm = async () => {
|
||||
mutate(null, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue