Yuki Takei 5 лет назад
Родитель
Сommit
836d9fd6b3
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/server/service/page.js

+ 3 - 2
src/server/service/page.js

@@ -28,6 +28,7 @@ class PageService {
     // Delete Bookmarks, Attachments, Revisions, Pages and emit delete
     // Delete Bookmarks, Attachments, Revisions, Pages and emit delete
     const Bookmark = this.crowi.model('Bookmark');
     const Bookmark = this.crowi.model('Bookmark');
     const Comment = this.crowi.model('Comment');
     const Comment = this.crowi.model('Comment');
+    const Page = this.crowi.model('Page');
     const PageTagRelation = this.crowi.model('PageTagRelation');
     const PageTagRelation = this.crowi.model('PageTagRelation');
     const ShareLink = this.crowi.model('ShareLink');
     const ShareLink = this.crowi.model('ShareLink');
     const Revision = this.crowi.model('Revision');
     const Revision = this.crowi.model('Revision');
@@ -38,9 +39,9 @@ class PageService {
       PageTagRelation.remove({ relatedPage: pageId }),
       PageTagRelation.remove({ relatedPage: pageId }),
       ShareLink.remove({ relatedPage: pageId }),
       ShareLink.remove({ relatedPage: pageId }),
       Revision.removeRevisionsByPath(pagePath),
       Revision.removeRevisionsByPath(pagePath),
+      Page.findByIdAndRemove(pageId),
+      Page.removeRedirectOriginPageByPath(pagePath),
       this.removeAllAttachments(pageId),
       this.removeAllAttachments(pageId),
-      this.findByIdAndRemove(pageId),
-      this.removeRedirectOriginPageByPath(pagePath),
     ]);
     ]);
   }
   }