Răsfoiți Sursa

Merge pull request #2510 from weseek/close-modal-after-get-request-of-counted-page

finish task
shizuma yoshimatsu 5 ani în urmă
părinte
comite
7aab01fd99

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

@@ -53,8 +53,8 @@ const ArchiveCreateModal = (props) => {
     setHierarchyValue(hierarchyValue);
   }
 
-  async function done() {
 
+  async function done() {
     try {
       await appContainer.apiv3Post('/page/archive', {
         rootPagePath: props.path,
@@ -66,6 +66,7 @@ const ArchiveCreateModal = (props) => {
         hierarchyValue,
       });
       toastSuccess(t('Submitted the request to create the archive'));
+      closeModalHandler();
     }
     catch (e) {
       toastError(e);
@@ -202,7 +203,7 @@ const ArchiveCreateModal = (props) => {
               <div className="my-1 custom-control costom-control-inline">
                 <input
                   type="number"
-                  min="0"
+                  min="1"
                   max="10"
                   disabled={hierarchyType === 'allSubordinatedPage'}
                   value={hierarchyValue}
@@ -238,7 +239,6 @@ ArchiveCreateModal.propTypes = {
   path: PropTypes.string.isRequired,
   totalPages: PropTypes.number,
   errorMessage: PropTypes.string,
-
 };
 
 export default withTranslation()(ArchiveCreateModalWrapper);

+ 5 - 1
src/server/routes/apiv3/page.js

@@ -282,7 +282,7 @@ module.exports = (crowi) => {
 
     const numOfPages = 1; // TODO 最終的にzipファイルに取り込むページ数を入れる
 
-    await PageArchive.create({
+    const createdPageArchive = PageArchive.create({
       owner,
       fileType,
       rootPagePath,
@@ -290,6 +290,10 @@ module.exports = (crowi) => {
       hasComment: isCommentDownload,
       hasAttachment: isAttachmentFileDownload,
     });
+
+    console.log(createdPageArchive);
+    return res.apiv3({ });
+
   });
 
   router.get('/count-children-pages', accessTokenParser, loginRequired, async(req, res) => {