diff --git a/src/app/(main)/admin/users/UserAddForm.tsx b/src/app/(main)/admin/users/UserAddForm.tsx
index 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.tsx
index 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.tsx
index 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.tsx
index 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.tsx
index 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.tsx
index 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)}
)}
-
- {formatMessage(labels.save)}
-
+ {formatMessage(labels.save)}
>
);
diff --git a/src/app/(main)/pixels/PixelDeleteButton.tsx b/src/app/(main)/pixels/PixelDeleteButton.tsx
index 0a81ab802..c90261e55 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, {
+ const handleConfirm = async (close: () => void) => {
+ await mutateAsync(null, {
onSuccess: () => {
touch('pixels');
onSave?.();
diff --git a/src/app/(main)/pixels/PixelEditButton.tsx b/src/app/(main)/pixels/PixelEditButton.tsx
index a1310d448..12977b815 100644
--- a/src/app/(main)/pixels/PixelEditButton.tsx
+++ b/src/app/(main)/pixels/PixelEditButton.tsx
@@ -9,7 +9,7 @@ export function PixelEditButton({ pixelId }: { pixelId: string }) {
return (
}>
-