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

Revert "Update validation"

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

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

@@ -65,7 +65,9 @@ export const updatePageHandlersFactory: UpdatePageHandlersFactory = (crowi) => {
   const validator: ValidationChain[] = [
     body('pageId').exists().not().isEmpty({ ignore_whitespace: true })
       .withMessage("'pageId' must be specified"),
-    body('revisionId').optional().isMongoId().withMessage("'revisionId' must be mongoId"),
+    body('revisionId').optional().exists().not()
+      .isEmpty({ ignore_whitespace: true })
+      .withMessage("'revisionId' must be specified"),
     body('body').exists().isString()
       .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'),