Yuki Takei 6 лет назад
Родитель
Сommit
39158c4dfd
3 измененных файлов с 1 добавлено и 4 удалено
  1. 1 0
      CHANGES.md
  2. 0 2
      src/server/models/page.js
  3. 0 2
      src/server/models/user-group.js

+ 1 - 0
CHANGES.md

@@ -4,6 +4,7 @@
 
 
 * Feature: Comment Thread
 * Feature: Comment Thread
 * Improvement Draft list
 * Improvement Draft list
+* Fix: Deleting page completely
 * Support: Apply unstated
 * Support: Apply unstated
 * Support: Upgrade libs
 * Support: Upgrade libs
     * mini-css-extract-plugin
     * mini-css-extract-plugin

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

@@ -1161,7 +1161,6 @@ 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 Revision = crowi.model('Revision');
     const Revision = crowi.model('Revision');
-    const PageGroupRelation = crowi.model('PageGroupRelation');
     const pageId = pageData._id;
     const pageId = pageData._id;
     const socketClientId = options.socketClientId || null;
     const socketClientId = options.socketClientId || null;
 
 
@@ -1173,7 +1172,6 @@ module.exports = function(crowi) {
     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);
-    await PageGroupRelation.removeAllByPage(pageData);
     if (socketClientId != null) {
     if (socketClientId != null) {
       pageEvent.emit('delete', pageData, user, socketClientId); // update as renamed page
       pageEvent.emit('delete', pageData, user, socketClientId); // update as renamed page
     }
     }

+ 0 - 2
src/server/models/user-group.js

@@ -91,7 +91,6 @@ class UserGroup {
 
 
   // グループの完全削除
   // グループの完全削除
   static async removeCompletelyById(deleteGroupId, action, selectedGroupId) {
   static async removeCompletelyById(deleteGroupId, action, selectedGroupId) {
-    const PageGroupRelation = mongoose.model('PageGroupRelation');
     const UserGroupRelation = mongoose.model('UserGroupRelation');
     const UserGroupRelation = mongoose.model('UserGroupRelation');
     const Page = mongoose.model('Page');
     const Page = mongoose.model('Page');
 
 
@@ -103,7 +102,6 @@ class UserGroup {
 
 
     await Promise.all([
     await Promise.all([
       UserGroupRelation.removeAllByUserGroup(deletedGroup),
       UserGroupRelation.removeAllByUserGroup(deletedGroup),
-      PageGroupRelation.removeAllByUserGroup(deletedGroup),
       Page.handlePrivatePagesForDeletedGroup(deletedGroup, action, selectedGroupId),
       Page.handlePrivatePagesForDeletedGroup(deletedGroup, action, selectedGroupId),
     ]);
     ]);