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

@ -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);