Răsfoiți Sursa

add Attachment.paginate()

zahmis 5 ani în urmă
părinte
comite
f54d8b3535

+ 1 - 1
src/client/js/components/PageAttachment.jsx

@@ -33,7 +33,7 @@ class PageAttachment extends React.Component {
     }
 
     const res = await this.props.appContainer.apiv3Get('/attachment/list', { pageId });
-    const attachments = res.data.attachments;
+    const attachments = res.data.result.attachments;
     const inUse = {};
 
     for (const attachment of attachments) {

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

@@ -54,7 +54,7 @@ module.exports = (crowi) => {
       }
 
       const attachments = await Attachment.find({ page: pageId });
-      const pagination = await Page.paginate({}, { queryOptions });
+      const pagination = await Attachment.paginate({}, { queryOptions });
 
       console.log(pagination);