Convert all mutate to mutateAsync.

This commit is contained in:
Mike Cao 2025-09-22 22:39:25 -07:00
parent 980e4e6b41
commit 6faf16e9aa
32 changed files with 78 additions and 97 deletions

View file

@ -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 () => {

View file

@ -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 () => {