Răsfoiți Sursa

rename isFileDownload to isAppendedFileDownload

zahmis 5 ani în urmă
părinte
comite
07108e802a

+ 6 - 6
src/client/js/components/ArchiveCreateModal.jsx

@@ -12,7 +12,7 @@ import { toastSuccess, toastError } from '../util/apiNotification';
 const ArchiveCreateModal = (props) => {
   const { t, appContainer } = props;
   const [isCommentDownload, setIsCommentDownload] = useState(false);
-  const [isFileDownload, setIsFileDownload] = useState(false);
+  const [isAppendedFileDownload, setIsAppendedFileDownload] = useState(false);
   const [isSubordinatedPageDownload, setIsSubordinatedPageDownload] = useState(false);
   const [fileType, setFileType] = useState('markDown');
   const [hierarchyType, setHierarchyType] = useState('allSubordinatedPage');
@@ -22,8 +22,8 @@ const ArchiveCreateModal = (props) => {
     setIsCommentDownload(!isCommentDownload);
   }
 
-  function changeIsFileDownloadHandler() {
-    setIsFileDownload(!isFileDownload);
+  function changeIsAppendedFileDownloadHandler() {
+    setIsAppendedFileDownload(!isAppendedFileDownload);
   }
 
   function changeIsSubordinatedPageDownloadHandler() {
@@ -58,7 +58,7 @@ const ArchiveCreateModal = (props) => {
     try {
       await appContainer.apiv3Post('/page/archive', {
         isCommentDownload,
-        isFileDownload,
+        isAppendedFileDownload,
         isSubordinatedPageDownload,
         fileType,
         hierarchyType,
@@ -140,8 +140,8 @@ const ArchiveCreateModal = (props) => {
             className="custom-control-input"
             id="downloadFile"
             type="checkbox"
-            checked={isFileDownload}
-            onChange={changeIsFileDownloadHandler}
+            checked={isAppendedFileDownload}
+            onChange={changeIsAppendedFileDownloadHandler}
           />
           <label className="custom-control-label" htmlFor="downloadFile">
             {t('Include Attachment File')}

+ 3 - 9
src/server/routes/apiv3/page.js

@@ -127,7 +127,7 @@ module.exports = (crowi) => {
 
     archive: [
       body('isCommentDownload').isBoolean(),
-      body('isFileDownload').isBoolean(),
+      body('isAppendedFileDownload').isBoolean(),
       body('isSubordinatedPageDownload').isBoolean(),
       body('fileType').isString().isIn(['pdf', 'markDown']),
       body('hierarchyType').isString().isIn(['allSubordinatedPage', 'decideHierarchy']),
@@ -195,22 +195,16 @@ module.exports = (crowi) => {
 
     const {
       isCommentDownload,
-      isFileDownload,
+      isAppendedFileDownload,
       isSubordinatedPageDownload,
       fileType,
       hierarchyType,
       hierarchyValue,
     } = req.body;
 
-    // const isCommentDownload = req.body.isCommentDownload;
-    // const isFileDownload = req.body.isFileDownload;
-    // const isSubordinatedPageDownload = req.body.isSubordinatedPageDownload;
-    // const fileType = req.body.fileType;
-    // const hierarchyType = req.body.hierarchyType;
-    // const hierarchyValue = req.body.hierarchyValue;
 
     console.log(isCommentDownload);
-    console.log(isFileDownload);
+    console.log(isAppendedFileDownload);
     console.log(fileType);
     console.log(isSubordinatedPageDownload);
     console.log(hierarchyType);