Explorar el Código

fix updata-page

Shun Miyazawa hace 2 años
padre
commit
e16a0f322a
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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

@@ -136,7 +136,9 @@ export const updatePageHandlersFactory: UpdatePageHandlersFactory = (crowi) => {
 
       // check revision
       const currentPage = await Page.findByIdAndViewer(pageId, req.user);
-      if (currentPage != null && !currentPage.isUpdatable(revisionId, origin)) {
+      const isUpdatable = await currentPage.isUpdatable(revisionId, origin);
+
+      if (currentPage != null && !isUpdatable) {
         const latestRevision = await Revision.findById(currentPage.revision).populate('author');
         const returnLatestRevision = {
           revisionId: latestRevision?._id.toString(),