Jelajahi Sumber

merge master to gw3232

白石誠 5 tahun lalu
induk
melakukan
be6d5f04e8
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  1. 2 4
      src/client/js/components/PageDuplicateModal.jsx

+ 2 - 4
src/client/js/components/PageDuplicateModal.jsx

@@ -6,7 +6,6 @@ import {
 } from 'reactstrap';
 
 import { withTranslation } from 'react-i18next';
-
 import { withUnstatedContainers } from './UnstatedUtils';
 
 import AppContainer from '../services/AppContainer';
@@ -28,7 +27,6 @@ const PageDuplicateModal = (props) => {
 
   const [subordinatedPaths, setSubordinatedPaths] = useState([]);
   const [getSubordinatedError, setGetSuborinatedError] = useState(null);
-
   const [isDuplicateRecursively, setIsDuplicateRecursively] = useState(true);
   const [isDuplicateRecursivelyAdmit, setIsDuplicateRecursivelyAdmit] = useState(true);
 
@@ -76,8 +74,8 @@ const PageDuplicateModal = (props) => {
     setErrs(null);
 
     try {
-      const res = await appContainer.apiPost('/pages.duplicate', { page_id: pageId, new_path: pageNameInput });
-      const { page } = res;
+      const res = await appContainer.apiv3Post('/pages/duplicate', { pageId, pageNameInput });
+      const { page } = res.data;
       window.location.href = encodeURI(`${page.path}?duplicated=${path}`);
     }
     catch (err) {