zahmis 5 年 前
コミット
a2c323aa4b

+ 5 - 2
src/client/js/components/PageAttachment.jsx

@@ -32,11 +32,14 @@ class PageAttachment extends React.Component {
       return;
     }
 
-    this.props.appContainer.apiGet('/attachments.list', { page_id: pageId })
+    this.props.appContainer.apiv3Get('/attachment/list', { pageId })
       .then((res) => {
-        const attachments = res.attachments;
+        const attachments = res.data.attachments;
         const inUse = {};
 
+        console.log(res);
+        console.log(res.data.attachments);
+
         for (const attachment of attachments) {
           inUse[attachment._id] = this.checkIfFileInUse(attachment);
         }

+ 1 - 2
src/server/routes/apiv3/attachment.js

@@ -41,8 +41,7 @@ module.exports = (crowi) => {
   router.get('/list', accessTokenParser, loginRequired, async(req, res) => {
 
     try {
-      const pageId = req.query.page;
-
+      const pageId = req.query.pageId;
       // check whether accessible
       const isAccessible = await Page.isAccessiblePageByViewer(pageId, req.user);
       if (!isAccessible) {