arvid-e 1 месяц назад
Родитель
Сommit
3f4d936f5f
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      apps/app/src/server/routes/apiv3/page/update-page.ts

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

@@ -123,19 +123,20 @@ export const updatePageHandlersFactory = (crowi: Crowi): RequestHandler[] => {
     const minimumRevisionForActivity = 2;
     const suppressUpdateWindow = 5 * 60 * 1000; // 5 min
 
+    // Check revision count
     const Revision = mongoose.model<IRevisionHasId>('Revision');
-
     const revisionCount = await Revision.countDocuments({
       pageId: updatedPage._id,
     });
     const hasEnoughRevisions = revisionCount > minimumRevisionForActivity;
 
+    // Check if within suppresion limit
     const timeSinceLastUpdateMs =
       Date.now() - lastUpdatedAtBeforeUpdate.getTime();
-
     const isOutsideSuppressionWindow =
       timeSinceLastUpdateMs > suppressUpdateWindow;
 
+    // Check if last updated user
     let isLastUpdatedUser: boolean;
     if (updatedPage.lastUpdateUser) {
       isLastUpdatedUser =