Convert all mutate to mutateAsync.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user