Shun Miyazawa 3 лет назад
Родитель
Сommit
bbfffcc115
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      packages/app/src/server/routes/apiv3/page-listing.ts

+ 3 - 2
packages/app/src/server/routes/apiv3/page-listing.ts

@@ -106,7 +106,7 @@ const routerFactory = (crowi: Crowi): Router => {
   // eslint-disable-next-line max-len
   router.get('/info', accessTokenParser, loginRequired, validator.pageIdsOrPathRequired, validator.infoParams, apiV3FormValidator, async(req: AuthorizedRequest, res: ApiV3Response) => {
     const {
-      pageIds, path, attachBookmarkCount: attachBookmarkCountParam, attachShortBody: attachShortBodyParam,
+      pageIds: pageIdsObj, path, attachBookmarkCount: attachBookmarkCountParam, attachShortBody: attachShortBodyParam,
     } = req.query;
 
     const attachBookmarkCount: boolean = attachBookmarkCountParam === 'true';
@@ -118,7 +118,8 @@ const routerFactory = (crowi: Crowi): Router => {
     const pageService: PageService = crowi.pageService!;
 
     try {
-      const pages = pageIds != null
+      const pageIds = Object.values(pageIdsObj ?? {});
+      const pages = pageIds != null && pageIds.length > 0
         ? await Page.findByIdsAndViewer(pageIds as string[], req.user, null, true)
         : await Page.findByPathAndViewer(path as string, req.user, null, false, true);