Просмотр исходного кода

Revert "fix"

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

+ 2 - 3
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: pageIdsObj, path, attachBookmarkCount: attachBookmarkCountParam, attachShortBody: attachShortBodyParam,
+      pageIds, path, attachBookmarkCount: attachBookmarkCountParam, attachShortBody: attachShortBodyParam,
     } = req.query;
 
     const attachBookmarkCount: boolean = attachBookmarkCountParam === 'true';
@@ -118,8 +118,7 @@ const routerFactory = (crowi: Crowi): Router => {
     const pageService: PageService = crowi.pageService!;
 
     try {
-      const pageIds = Object.values(pageIdsObj ?? {});
-      const pages = pageIds != null && pageIds.length > 0
+      const pages = pageIds != null
         ? await Page.findByIdsAndViewer(pageIds as string[], req.user, null, true)
         : await Page.findByPathAndViewer(path as string, req.user, null, false, true);