|
@@ -3,7 +3,6 @@ import {
|
|
|
Modal, ModalHeader, ModalBody, ModalFooter,
|
|
Modal, ModalHeader, ModalBody, ModalFooter,
|
|
|
} from 'reactstrap';
|
|
} from 'reactstrap';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
-import nodePath from 'path';
|
|
|
|
|
|
|
|
|
|
import { apiPost } from '~/client/util/apiv1-client';
|
|
import { apiPost } from '~/client/util/apiv1-client';
|
|
|
import { usePageDeleteModalStatus, usePageDeleteModalOpened } from '~/stores/ui';
|
|
import { usePageDeleteModalStatus, usePageDeleteModalOpened } from '~/stores/ui';
|
|
@@ -38,9 +37,10 @@ const PageDeleteModal: FC<Props> = (props: Props) => {
|
|
|
isDeleteCompletelyModal, isAbleToDeleteCompletely,
|
|
isDeleteCompletelyModal, isAbleToDeleteCompletely,
|
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const { data: pagesDataToDelete, close: closeDeleteModal } = usePageDeleteModalStatus();
|
|
const { data: pagesDataToDelete, close: closeDeleteModal } = usePageDeleteModalStatus();
|
|
|
- const { data: isOpened } = usePageDeleteModalOpened();
|
|
|
|
|
|
|
+ const { data: pageDeleteModalOpened } = usePageDeleteModalOpened();
|
|
|
|
|
+
|
|
|
|
|
+ const isOpened = pageDeleteModalOpened?.isOpend != null ? pageDeleteModalOpened.isOpend : false;
|
|
|
|
|
|
|
|
const [isDeleteRecursively, setIsDeleteRecursively] = useState(true);
|
|
const [isDeleteRecursively, setIsDeleteRecursively] = useState(true);
|
|
|
const [isDeleteCompletely, setIsDeleteCompletely] = useState(isDeleteCompletelyModal && isAbleToDeleteCompletely);
|
|
const [isDeleteCompletely, setIsDeleteCompletely] = useState(isDeleteCompletelyModal && isAbleToDeleteCompletely);
|
|
@@ -77,10 +77,11 @@ const PageDeleteModal: FC<Props> = (props: Props) => {
|
|
|
completely,
|
|
completely,
|
|
|
}) as IPageApiv1Result;
|
|
}) as IPageApiv1Result;
|
|
|
|
|
|
|
|
- const trashPagePath = result.page.path;
|
|
|
|
|
-
|
|
|
|
|
- window.location.href = encodeURI(trashPagePath);
|
|
|
|
|
|
|
+ const redirectPagePath = result.page.path;
|
|
|
|
|
|
|
|
|
|
+ if (pageDeleteModalOpened?.onDeleted) {
|
|
|
|
|
+ pageDeleteModalOpened.onDeleted(redirectPagePath);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
setErrs(err);
|
|
setErrs(err);
|