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

+ 1 - 3
apps/app/src/server/routes/apiv3/page/update-page.ts

@@ -65,9 +65,7 @@ export const updatePageHandlersFactory: UpdatePageHandlersFactory = (crowi) => {
   const validator: ValidationChain[] = [
   const validator: ValidationChain[] = [
     body('pageId').exists().not().isEmpty({ ignore_whitespace: true })
     body('pageId').exists().not().isEmpty({ ignore_whitespace: true })
       .withMessage("'pageId' must be specified"),
       .withMessage("'pageId' must be specified"),
-    body('revisionId').optional().exists().not()
-      .isEmpty({ ignore_whitespace: true })
-      .withMessage("'revisionId' must be specified"),
+    body('revisionId').optional().isMongoId().withMessage("'revisionId' must be mongoId"),
     body('body').exists().isString()
     body('body').exists().isString()
       .withMessage("The empty value is not allowd for the 'body'"),
       .withMessage("The empty value is not allowd for the 'body'"),
     body('grant').optional().isInt({ min: 0, max: 5 }).withMessage('grant must be integer from 1 to 5'),
     body('grant').optional().isInt({ min: 0, max: 5 }).withMessage('grant must be integer from 1 to 5'),