mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Convert all mutate to mutateAsync.
This commit is contained in:
parent
980e4e6b41
commit
6faf16e9aa
32 changed files with 78 additions and 97 deletions
|
|
@ -14,11 +14,11 @@ export function PixelDeleteButton({
|
|||
onSave?: () => void;
|
||||
}) {
|
||||
const { formatMessage, labels, getErrorMessage } = useMessages();
|
||||
const { mutate, isPending, error } = useDeleteQuery(`/pixels/${pixelId}`);
|
||||
const { mutateAsync, isPending, error } = useDeleteQuery(`/pixels/${pixelId}`);
|
||||
const { touch } = useModified();
|
||||
|
||||
const handleConfirm = (close: () => void) => {
|
||||
mutate(null, {
|
||||
await mutateAsync(null, {
|
||||
onSuccess: () => {
|
||||
touch('pixels');
|
||||
onSave?.();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function PixelEditForm({
|
|||
onClose?: () => void;
|
||||
}) {
|
||||
const { formatMessage, labels, messages, getErrorMessage } = useMessages();
|
||||
const { mutate, error, isPending, touch, toast } = useUpdateQuery(
|
||||
const { mutateAsync, error, isPending, touch, toast } = useUpdateQuery(
|
||||
pixelId ? `/pixels/${pixelId}` : '/pixels',
|
||||
{
|
||||
id: pixelId,
|
||||
|
|
@ -45,7 +45,7 @@ export function PixelEditForm({
|
|||
const [slug, setSlug] = useState(generateId());
|
||||
|
||||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
await mutateAsync(data, {
|
||||
onSuccess: async () => {
|
||||
toast(formatMessage(messages.saved));
|
||||
touch('pixels');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue