zahmis 5 лет назад
Родитель
Сommit
17d3c9fc85
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      src/server/routes/apiv3/attachment.js

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

@@ -51,7 +51,6 @@ module.exports = (crowi) => {
   router.get('/list', accessTokenParser, loginRequired, validator.retrieveAttachments, apiV3FormValidator, async(req, res) => {
     const offset = +req.query.offset || 0;
     const limit = +req.query.limit || 30;
-    const queryOptions = { offset, limit };
 
     try {
       const pageId = req.query.pageId;
@@ -64,7 +63,13 @@ module.exports = (crowi) => {
 
       const paginateResult = await Attachment.paginate(
         { page: pageId },
-        queryOptions,
+        {
+          limit,
+          offset,
+          populate: {
+            path: 'creator',
+          },
+        },
       );
 
       return res.apiv3({ paginateResult });