Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Convert all mutate to mutateAsync.
Mike Cao6faf16e9aa5a
diff --git a/src/app/(main)/admin/users/UserAddForm.tsx b/src/app/(main)/admin/users/UserAddForm.tsxindex f6881a109..fe7828c60 100644--- a/src/app/(main)/admin/users/UserAddForm.tsx+++ b/src/app/(main)/admin/users/UserAddForm.tsx@@ -13,11 +13,11 @@ import { useMessages, useUpdateQuery } from '@/components/hooks';import { ROLES } from '@/lib/constants';export function UserAddForm({ onSave, onClose }) {- const { mutate, error, isPending } = useUpdateQuery(`/users`);+ const { mutateAsync, error, isPending } = useUpdateQuery(`/users`);const { formatMessage, labels, getErrorMessage } = useMessages();const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave(data);onClose();diff --git a/src/app/(main)/admin/users/UserDeleteForm.tsx b/src/app/(main)/admin/users/UserDeleteForm.tsxindex f316dafef..8f6fd502b 100644--- a/src/app/(main)/admin/users/UserDeleteForm.tsx+++ b/src/app/(main)/admin/users/UserDeleteForm.tsx@@ -13,11 +13,11 @@ export function UserDeleteForm({onClose?: () => void;}) {const { messages, labels, formatMessage } = useMessages();- const { mutate } = useDeleteQuery(`/users/${userId}`);+ const { mutateAsync } = useDeleteQuery(`/users/${userId}`);const { touch } = useModified();const handleConfirm = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {touch('users');touch(`users:${userId}`);diff --git a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx b/src/app/(main)/admin/users/[userId]/UserEditForm.tsxindex 9a8d34cc2..ac7875db0 100644--- a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx+++ b/src/app/(main)/admin/users/[userId]/UserEditForm.tsx@@ -16,10 +16,10 @@ export function UserEditForm({ userId, onSave }: { userId: string; onSave?: () =const user = useUser();const { user: login } = useLoginQuery();- const { mutate, error, toast, touch } = useUpdateQuery(`/users/${userId}`);+ const { mutateAsync, error, toast, touch } = useUpdateQuery(`/users/${userId}`);const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {toast(formatMessage(messages.saved));touch(`user:${user.id}`);diff --git a/src/app/(main)/boards/BoardAddForm.tsx b/src/app/(main)/boards/BoardAddForm.tsxindex fae3c70aa..e04670822 100644--- a/src/app/(main)/boards/BoardAddForm.tsx+++ b/src/app/(main)/boards/BoardAddForm.tsx@@ -13,10 +13,10 @@ export function BoardAddForm({onClose?: () => void;}) {const { formatMessage, labels, messages } = useMessages();- const { mutate, error, isPending } = useUpdateQuery('/websites', { teamId });+ const { mutateAsync, error, isPending } = useUpdateQuery('/websites', { teamId });const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave?.();onClose?.();diff --git a/src/app/(main)/links/LinkDeleteButton.tsx b/src/app/(main)/links/LinkDeleteButton.tsxindex cfecb4259..05a3217f7 100644--- a/src/app/(main)/links/LinkDeleteButton.tsx+++ b/src/app/(main)/links/LinkDeleteButton.tsx@@ -16,10 +16,10 @@ export function LinkDeleteButton({onSave?: () => void;}) {const { formatMessage, labels, getErrorMessage } = useMessages();- const { mutate, isPending, error, touch } = useDeleteQuery(`/links/${linkId}`);+ const { mutateAsync, isPending, error, touch } = useDeleteQuery(`/links/${linkId}`);- const handleConfirm = (close: () => void) => {- mutate(null, {+ const handleConfirm = async (close: () => void) => {+ await mutateAsync(null, {onSuccess: () => {touch('links');onSave?.();diff --git a/src/app/(main)/links/LinkEditForm.tsx b/src/app/(main)/links/LinkEditForm.tsxindex ab1b0e40d..36a114552 100644--- a/src/app/(main)/links/LinkEditForm.tsx+++ b/src/app/(main)/links/LinkEditForm.tsx@@ -33,7 +33,7 @@ export function LinkEditForm({onClose?: () => void;}) {const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch, toast } = useUpdateQuery(+ const { mutateAsync, error, isPending, touch, toast } = useUpdateQuery(linkId ? `/links/${linkId}` : '/links',{id: linkId,@@ -46,7 +46,7 @@ export function LinkEditForm({const [slug, setSlug] = useState(generateId());const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {toast(formatMessage(messages.saved));touch('links');@@ -139,9 +139,7 @@ export function LinkEditForm({{formatMessage(labels.cancel)}</Button>)}- <FormSubmitButton isDisabled={false} isLoading={isPending}>- {formatMessage(labels.save)}- </FormSubmitButton>+ <FormSubmitButton>{formatMessage(labels.save)}</FormSubmitButton></Row></>);diff --git a/src/app/(main)/pixels/PixelDeleteButton.tsx b/src/app/(main)/pixels/PixelDeleteButton.tsxindex 0a81ab802..4e5024dda 100644--- a/src/app/(main)/pixels/PixelDeleteButton.tsx+++ b/src/app/(main)/pixels/PixelDeleteButton.tsx@@ -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?.();diff --git a/src/app/(main)/pixels/PixelEditForm.tsx b/src/app/(main)/pixels/PixelEditForm.tsxindex b85d363bb..9caae7644 100644--- a/src/app/(main)/pixels/PixelEditForm.tsx+++ b/src/app/(main)/pixels/PixelEditForm.tsx@@ -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');diff --git a/src/app/(main)/settings/profile/PasswordEditForm.tsx b/src/app/(main)/settings/profile/PasswordEditForm.tsxindex f0df01df8..2c27a2d51 100644--- a/src/app/(main)/settings/profile/PasswordEditForm.tsx+++ b/src/app/(main)/settings/profile/PasswordEditForm.tsx@@ -10,10 +10,10 @@ import { useMessages, useUpdateQuery } from '@/components/hooks';export function PasswordEditForm({ onSave, onClose }) {const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending } = useUpdateQuery('/me/password');+ const { mutateAsync, error, isPending } = useUpdateQuery('/me/password');const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave();onClose();diff --git a/src/app/(main)/teams/TeamAddForm.tsx b/src/app/(main)/teams/TeamAddForm.tsxindex 68ff79786..87a6a4fd6 100644--- a/src/app/(main)/teams/TeamAddForm.tsx+++ b/src/app/(main)/teams/TeamAddForm.tsx@@ -10,10 +10,10 @@ import {export function TeamAddForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {const { formatMessage, labels, getErrorMessage } = useMessages();- const { mutate, error, isPending } = useUpdateQuery('/teams');+ const { mutateAsync, error, isPending } = useUpdateQuery('/teams');const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave?.();onClose?.();diff --git a/src/app/(main)/teams/TeamJoinForm.tsx b/src/app/(main)/teams/TeamJoinForm.tsxindex f69099ed4..0c896747e 100644--- a/src/app/(main)/teams/TeamJoinForm.tsx+++ b/src/app/(main)/teams/TeamJoinForm.tsx@@ -10,10 +10,10 @@ import { useMessages, useUpdateQuery } from '@/components/hooks';export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {const { formatMessage, labels, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch } = useUpdateQuery('/teams/join');+ const { mutateAsync, error, touch } = useUpdateQuery('/teams/join');const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {touch('teams:members');onSave?.();@@ -33,9 +33,7 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:</FormField><FormButtons><Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>- <FormSubmitButton variant="primary" isLoading={isPending} isDisabled={isPending}>- {formatMessage(labels.join)}- </FormSubmitButton>+ <FormSubmitButton variant="primary">{formatMessage(labels.join)}</FormSubmitButton></FormButtons></Form>);diff --git a/src/app/(main)/teams/TeamLeaveForm.tsx b/src/app/(main)/teams/TeamLeaveForm.tsxindex 2c7a41d20..c8063365b 100644--- a/src/app/(main)/teams/TeamLeaveForm.tsx+++ b/src/app/(main)/teams/TeamLeaveForm.tsx@@ -15,11 +15,11 @@ export function TeamLeaveForm({onClose: () => void;}) {const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending } = useDeleteQuery(`/teams/${teamId}/users/${userId}`);+ const { mutateAsync, error, isPending } = useDeleteQuery(`/teams/${teamId}/users/${userId}`);const { touch } = useModified();const handleConfirm = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {touch('teams:members');onSave();diff --git a/src/app/(main)/teams/[teamId]/TeamDeleteForm.tsx b/src/app/(main)/teams/[teamId]/TeamDeleteForm.tsxindex 3634af568..cf1ce6188 100644--- a/src/app/(main)/teams/[teamId]/TeamDeleteForm.tsx+++ b/src/app/(main)/teams/[teamId]/TeamDeleteForm.tsx@@ -13,10 +13,10 @@ export function TeamDeleteForm({onClose?: () => void;}) {const { labels, formatMessage, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch } = useDeleteQuery(`/teams/${teamId}`);+ const { mutateAsync, error, isPending, touch } = useDeleteQuery(`/teams/${teamId}`);const handleConfirm = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {touch('teams');onSave?.();diff --git a/src/app/(main)/teams/[teamId]/TeamEditForm.tsx b/src/app/(main)/teams/[teamId]/TeamEditForm.tsxindex 2b6690ff2..debea5d4d 100644--- a/src/app/(main)/teams/[teamId]/TeamEditForm.tsx+++ b/src/app/(main)/teams/[teamId]/TeamEditForm.tsx@@ -25,10 +25,10 @@ export function TeamEditForm({const team = useTeam();const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch, toast } = useUpdateQuery(`/teams/${teamId}`);+ const { mutateAsync, error, isPending, touch, toast } = useUpdateQuery(`/teams/${teamId}`);const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {toast(formatMessage(messages.saved));touch('teams');diff --git a/src/app/(main)/teams/[teamId]/TeamMemberEditForm.tsx b/src/app/(main)/teams/[teamId]/TeamMemberEditForm.tsxindex e64a9b274..76f0800f1 100644--- a/src/app/(main)/teams/[teamId]/TeamMemberEditForm.tsx+++ b/src/app/(main)/teams/[teamId]/TeamMemberEditForm.tsx@@ -23,11 +23,11 @@ export function TeamMemberEditForm({onSave?: () => void;onClose?: () => void;}) {- const { mutate, error, isPending } = useUpdateQuery(`/teams/${teamId}/users/${userId}`);+ const { mutateAsync, error, isPending } = useUpdateQuery(`/teams/${teamId}/users/${userId}`);const { formatMessage, labels, getErrorMessage } = useMessages();const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave();onClose();diff --git a/src/app/(main)/teams/[teamId]/TeamMemberRemoveButton.tsx b/src/app/(main)/teams/[teamId]/TeamMemberRemoveButton.tsxindex 66d540b00..708f8a27c 100644--- a/src/app/(main)/teams/[teamId]/TeamMemberRemoveButton.tsx+++ b/src/app/(main)/teams/[teamId]/TeamMemberRemoveButton.tsx@@ -18,11 +18,11 @@ export function TeamMemberRemoveButton({onSave?: () => void;}) {const { formatMessage, labels } = useMessages();- const { mutate, isPending, error } = useDeleteQuery(`/teams/${teamId}/users/${userId}`);+ const { mutateAsync, isPending, error } = useDeleteQuery(`/teams/${teamId}/users/${userId}`);const { touch } = useModified();const handleConfirm = (close: () => void) => {- mutate(null, {+ await mutateAsync(null, {onSuccess: () => {touch('teams:members');onSave?.();diff --git a/src/app/(main)/teams/[teamId]/TeamWebsiteRemoveButton.tsx b/src/app/(main)/teams/[teamId]/TeamWebsiteRemoveButton.tsxindex 34e8184e9..c3a68c57f 100644--- a/src/app/(main)/teams/[teamId]/TeamWebsiteRemoveButton.tsx+++ b/src/app/(main)/teams/[teamId]/TeamWebsiteRemoveButton.tsx@@ -1,13 +1,13 @@import { useDeleteQuery, useMessages } from '@/components/hooks';import { Icon, LoadingButton, Text } from '@umami/react-zen';-import { Close } from '@/components/icons';+import { X } from '@/components/icons';export function TeamWebsiteRemoveButton({ teamId, websiteId, onSave }) {const { formatMessage, labels } = useMessages();- const { mutate, isPending } = useDeleteQuery(`/teams/${teamId}/websites/${websiteId}`);+ const { mutateAsync } = useDeleteQuery(`/teams/${teamId}/websites/${websiteId}`);const handleRemoveTeamMember = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: () => {onSave();},@@ -15,9 +15,9 @@ export function TeamWebsiteRemoveButton({ teamId, websiteId, onSave }) {};return (- <LoadingButton variant="quiet" onClick={() => handleRemoveTeamMember()} isLoading={isPending}>+ <LoadingButton variant="quiet" onClick={() => handleRemoveTeamMember()}><Icon>- <Close />+ <X /></Icon><Text>{formatMessage(labels.remove)}</Text></LoadingButton>diff --git a/src/app/(main)/websites/WebsiteAddForm.tsx b/src/app/(main)/websites/WebsiteAddForm.tsxindex e2be25633..b8ff7b459 100644--- a/src/app/(main)/websites/WebsiteAddForm.tsx+++ b/src/app/(main)/websites/WebsiteAddForm.tsx@@ -13,10 +13,10 @@ export function WebsiteAddForm({onClose?: () => void;}) {const { formatMessage, labels, messages } = useMessages();- const { mutate, error, isPending } = useUpdateQuery('/websites', { teamId });+ const { mutateAsync, error, isPending } = useUpdateQuery('/websites', { teamId });const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {onSave?.();onClose?.();diff --git a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsxindex 01940beb0..30976bff7 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx@@ -33,12 +33,10 @@ export function FunnelEditForm({}) {const { formatMessage, labels } = useMessages();const { data } = useReportQuery(id);- const { mutate, error, isPending, touch } = useUpdateQuery(`/reports${id ? `/${id}` : ''}`);+ const { mutateAsync, error, isPending, touch } = useUpdateQuery(`/reports${id ? `/${id}` : ''}`);const handleSubmit = async ({ name, ...parameters }) => {- //-- mutate(+ await mutateAsync({ ...data, id, name, type: 'funnel', websiteId, parameters },{onSuccess: async () => {diff --git a/src/app/(main)/websites/[websiteId]/(reports)/goals/GoalEditForm.tsx b/src/app/(main)/websites/[websiteId]/(reports)/goals/GoalEditForm.tsxindex 2264ccf89..394cdec90 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/goals/GoalEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/(reports)/goals/GoalEditForm.tsx@@ -27,10 +27,10 @@ export function GoalEditForm({}) {const { formatMessage, labels } = useMessages();const { data } = useReportQuery(id);- const { mutate, error, isPending, touch } = useUpdateQuery(`/reports${id ? `/${id}` : ''}`);+ const { mutateAsync, error, isPending, touch } = useUpdateQuery(`/reports${id ? `/${id}` : ''}`);const handleSubmit = async (formData: Record<string, any>) => {- mutate(+ await mutateAsync({ ...formData, type: 'goal', websiteId },{onSuccess: async () => {diff --git a/src/app/(main)/websites/[websiteId]/cohorts/CohortDeleteButton.tsx b/src/app/(main)/websites/[websiteId]/cohorts/CohortDeleteButton.tsxindex 9e56a875f..7b7d0d1cc 100644--- a/src/app/(main)/websites/[websiteId]/cohorts/CohortDeleteButton.tsx+++ b/src/app/(main)/websites/[websiteId]/cohorts/CohortDeleteButton.tsx@@ -17,12 +17,12 @@ export function CohortDeleteButton({onSave?: () => void;}) {const { formatMessage, labels } = useMessages();- const { mutate, isPending, error, touch } = useDeleteQuery(+ const { mutateAsync, isPending, error, touch } = useDeleteQuery(`/websites/${websiteId}/segments/${cohortId}`,);const handleConfirm = (close: () => void) => {- mutate(null, {+ await mutateAsync(null, {onSuccess: () => {touch('cohorts');onSave?.();diff --git a/src/app/(main)/websites/[websiteId]/cohorts/CohortEditForm.tsx b/src/app/(main)/websites/[websiteId]/cohorts/CohortEditForm.tsxindex c02d85c9a..3b228e835 100644--- a/src/app/(main)/websites/[websiteId]/cohorts/CohortEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/cohorts/CohortEditForm.tsx@@ -33,7 +33,7 @@ export function CohortEditForm({const { data } = useWebsiteCohortQuery(websiteId, cohortId);const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch, toast } = useUpdateQuery(+ const { mutateAsync, error, isPending, touch, toast } = useUpdateQuery(`/websites/${websiteId}/segments${cohortId ? `/${cohortId}` : ''}`,{type: 'cohort',@@ -41,7 +41,7 @@ export function CohortEditForm({);const handleSubmit = async (formData: any) => {- mutate(formData, {+ await mutateAsync(formData, {onSuccess: async () => {toast(formatMessage(messages.saved));touch('cohorts');diff --git a/src/app/(main)/websites/[websiteId]/segments/SegmentDeleteButton.tsx b/src/app/(main)/websites/[websiteId]/segments/SegmentDeleteButton.tsxindex f212187b8..2dd5e1053 100644--- a/src/app/(main)/websites/[websiteId]/segments/SegmentDeleteButton.tsx+++ b/src/app/(main)/websites/[websiteId]/segments/SegmentDeleteButton.tsx@@ -17,12 +17,12 @@ export function SegmentDeleteButton({onSave?: () => void;}) {const { formatMessage, labels } = useMessages();- const { mutate, isPending, error, touch } = useDeleteQuery(+ const { mutateAsync, isPending, error, touch } = useDeleteQuery(`/websites/${websiteId}/segments/${segmentId}`,);const handleConfirm = (close: () => void) => {- mutate(null, {+ await mutateAsync(null, {onSuccess: () => {touch('segments');onSave?.();diff --git a/src/app/(main)/websites/[websiteId]/segments/SegmentEditForm.tsx b/src/app/(main)/websites/[websiteId]/segments/SegmentEditForm.tsxindex 32b7ee931..26b973529 100644--- a/src/app/(main)/websites/[websiteId]/segments/SegmentEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/segments/SegmentEditForm.tsx@@ -30,7 +30,7 @@ export function SegmentEditForm({const { data } = useWebsiteSegmentQuery(websiteId, segmentId);const { formatMessage, labels, getErrorMessage } = useMessages();- const { mutate, error, isPending, touch, toast } = useUpdateQuery(+ const { mutateAsync, error, isPending, touch, toast } = useUpdateQuery(`/websites/${websiteId}/segments${segmentId ? `/${segmentId}` : ''}`,{type: 'segment',@@ -38,7 +38,7 @@ export function SegmentEditForm({);const handleSubmit = async (formData: any) => {- mutate(formData, {+ await mutateAsync(formData, {onSuccess: async () => {toast(formatMessage(messages.saved));touch('segments');diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteDeleteForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteDeleteForm.tsxindex a123813d0..780aab74e 100644--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteDeleteForm.tsx+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteDeleteForm.tsx@@ -13,10 +13,10 @@ export function WebsiteDeleteForm({onClose?: () => void;}) {const { formatMessage, labels } = useMessages();- const { mutate, isPending, error, touch } = useDeleteQuery(`/websites/${websiteId}`);+ const { mutateAsync, isPending, error, touch } = useDeleteQuery(`/websites/${websiteId}`);const handleConfirm = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {touch('websites');touch(`websites:${websiteId}`);diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteEditForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteEditForm.tsxindex e79ec922b..50598199a 100644--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteEditForm.tsx@@ -5,10 +5,10 @@ import { DOMAIN_REGEX } from '@/lib/constants';export function WebsiteEditForm({ websiteId, onSave }: { websiteId: string; onSave?: () => void }) {const website = useWebsite();const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, touch, toast, isPending } = useUpdateQuery(`/websites/${websiteId}`);+ const { mutateAsync, error, touch, toast } = useUpdateQuery(`/websites/${websiteId}`);const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {toast(formatMessage(messages.saved));touch(`website:${website.id}`);@@ -45,12 +45,7 @@ export function WebsiteEditForm({ websiteId, onSave }: { websiteId: string; onSa<TextField /></FormField><FormButtons>- <FormSubmitButton- data-test="button-submit"- variant="primary"- isLoading={isPending}- isDisabled={isPending}- >+ <FormSubmitButton data-test="button-submit" variant="primary">{formatMessage(labels.save)}</FormSubmitButton></FormButtons>diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteResetForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteResetForm.tsxindex 3c990ded9..43583c3e2 100644--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteResetForm.tsx+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteResetForm.tsx@@ -13,10 +13,10 @@ export function WebsiteResetForm({onClose?: () => void;}) {const { formatMessage, labels } = useMessages();- const { mutate, isPending, error } = useUpdateQuery(`/websites/${websiteId}/reset`);+ const { mutateAsync, isPending, error } = useUpdateQuery(`/websites/${websiteId}/reset`);const handleConfirm = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {onSave?.();onClose?.();diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsxindex f828d9e11..dc2fe6892 100644--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx@@ -25,7 +25,7 @@ export interface WebsiteShareFormProps {export function WebsiteShareForm({ websiteId, shareId, onSave, onClose }: WebsiteShareFormProps) {const { formatMessage, labels, messages, getErrorMessage } = useMessages();const [id, setId] = useState(shareId);- const { mutate, error, isPending, touch, toast } = useUpdateQuery(`/websites/${websiteId}`);+ const { mutateAsync, error, touch, toast } = useUpdateQuery(`/websites/${websiteId}`);const url = `${window?.location.origin || ''}${process.env.basePath || ''}/share/${id}`;@@ -37,11 +37,11 @@ export function WebsiteShareForm({ websiteId, shareId, onSave, onClose }: WebsitsetId(id ? null : generateId());};- const handleSave = () => {+ const handleSave = async () => {const data = {shareId: id,};- mutate(data, {+ await mutateAsync(data, {onSuccess: async () => {toast(formatMessage(messages.saved));touch(`website:${websiteId}`);@@ -69,9 +69,7 @@ export function WebsiteShareForm({ websiteId, shareId, onSave, onClose }: Websit</Row><Row alignItems="center" gap>{onClose && <Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>}- <FormSubmitButton isDisabled={false} isLoading={isPending}>- {formatMessage(labels.save)}- </FormSubmitButton>+ <FormSubmitButton isDisabled={false}>{formatMessage(labels.save)}</FormSubmitButton></Row></FormButtons></Column>diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsxindex f7461a445..9752a48e5 100644--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx@@ -32,7 +32,7 @@ export function WebsiteTransferForm({const website = useWebsite();const [teamId, setTeamId] = useState<string>(null);const { formatMessage, labels, messages, getErrorMessage } = useMessages();- const { mutate, error, isPending } = useUpdateQuery(`/websites/${websiteId}/transfer`);+ const { mutateAsync, error, isPending } = useUpdateQuery(`/websites/${websiteId}/transfer`);const { data: teams, isLoading } = useUserTeamsQuery(user.id);const isTeamWebsite = !!website?.teamId;@@ -45,7 +45,7 @@ export function WebsiteTransferForm({) || [];const handleSubmit = async () => {- mutate(+ await mutateAsync({userId: website.teamId ? user.id : undefined,teamId: website.userId ? teamId : undefined,diff --git a/src/app/login/LoginForm.tsx b/src/app/login/LoginForm.tsxindex 3dcbadef7..90ac981ab 100644--- a/src/app/login/LoginForm.tsx+++ b/src/app/login/LoginForm.tsx@@ -18,10 +18,10 @@ import { LogoSvg } from '@/components/icons';export function LoginForm() {const { formatMessage, labels, getErrorMessage } = useMessages();const router = useRouter();- const { mutate, error, isPending } = useUpdateQuery('/auth/login');+ const { mutateAsync, error } = useUpdateQuery('/auth/login');const handleSubmit = async (data: any) => {- mutate(data, {+ await mutateAsync(data, {onSuccess: async ({ token, user }) => {setClientAuthToken(token);setUser(user);@@ -55,13 +55,7 @@ export function LoginForm() {<PasswordField /></FormField><FormButtons>- <FormSubmitButton- data-test="button-submit"- variant="primary"- isLoading={isPending}- isDisabled={isPending}- style={{ flex: 1 }}- >+ <FormSubmitButton data-test="button-submit" variant="primary" style={{ flex: 1 }}>{formatMessage(labels.login)}</FormSubmitButton></FormButtons>diff --git a/src/components/input/ReportEditButton.tsx b/src/components/input/ReportEditButton.tsxindex 38fa17dd3..8f0c7a3cc 100644--- a/src/components/input/ReportEditButton.tsx+++ b/src/components/input/ReportEditButton.tsx@@ -31,7 +31,7 @@ export function ReportEditButton({const { formatMessage, labels, messages } = useMessages();const [showEdit, setShowEdit] = useState(false);const [showDelete, setShowDelete] = useState(false);- const { mutate, touch } = useDeleteQuery(`/reports/${id}`);+ const { mutateAsync, touch } = useDeleteQuery(`/reports/${id}`);const handleAction = (id: any) => {if (id === 'edit') {@@ -47,7 +47,7 @@ export function ReportEditButton({};const handleDelete = async () => {- mutate(null, {+ await mutateAsync(null, {onSuccess: async () => {touch(`reports:${type}`);setShowDelete(false);diff --git a/src/components/input/SettingsButton.tsx b/src/components/input/SettingsButton.tsxindex 68fd2cdc3..9afe6e0b6 100644--- a/src/components/input/SettingsButton.tsx+++ b/src/components/input/SettingsButton.tsx@@ -19,14 +19,14 @@ export function SettingsButton() {const { cloudMode } = useConfig();const handleAction = (id: Key) => {- if (id === 'settings') {- if (cloudMode) {- window.location.href = `/settings`;- return;- }+ const url = `/${id}`;++ if (cloudMode) {+ window.location.href = url;+ return;}- router.push(renderUrl(`/${id}`));+ router.push(renderUrl(url));};return (