Browse Source

add sharelink remove

itizawa 5 years ago
parent
commit
f41abb174a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/server/models/page.js

+ 2 - 0
src/server/models/page.js

@@ -1163,6 +1163,7 @@ module.exports = function(crowi) {
     const Attachment = crowi.model('Attachment');
     const Attachment = crowi.model('Attachment');
     const Comment = crowi.model('Comment');
     const Comment = crowi.model('Comment');
     const PageTagRelation = crowi.model('PageTagRelation');
     const PageTagRelation = crowi.model('PageTagRelation');
+    const ShareLink = crowi.model('ShareLink');
     const Revision = crowi.model('Revision');
     const Revision = crowi.model('Revision');
     const pageId = pageData._id;
     const pageId = pageData._id;
     const socketClientId = options.socketClientId || null;
     const socketClientId = options.socketClientId || null;
@@ -1173,6 +1174,7 @@ module.exports = function(crowi) {
     await Attachment.removeAttachmentsByPageId(pageId);
     await Attachment.removeAttachmentsByPageId(pageId);
     await Comment.removeCommentsByPageId(pageId);
     await Comment.removeCommentsByPageId(pageId);
     await PageTagRelation.remove({ relatedPage: pageId });
     await PageTagRelation.remove({ relatedPage: pageId });
+    await ShareLink.remove({ relatedPage: pageId });
     await Revision.removeRevisionsByPath(pageData.path);
     await Revision.removeRevisionsByPath(pageData.path);
     await this.findByIdAndRemove(pageId);
     await this.findByIdAndRemove(pageId);
     await this.removeRedirectOriginPageByPath(pageData.path);
     await this.removeRedirectOriginPageByPath(pageData.path);