Просмотр исходного кода

Commented out findNotEmptyParentByPathRecursively TODO comment

Taichi Masuyama 3 лет назад
Родитель
Сommit
257441ab79
1 измененных файлов с 10 добавлено и 14 удалено
  1. 10 14
      packages/app/src/server/models/page.ts

+ 10 - 14
packages/app/src/server/models/page.ts

@@ -1013,23 +1013,19 @@ schema.statics.removeEmptyPages = async function(pageIdsToNotRemove: ObjectIdLik
 };
 
 // TODO: implement this method
-schema.statics.findNotEmptyParentByPathRecursively = async function(path: string) {
-  // Find a page on the tree by path
-  // Find not empty parent
-  return;
-};
-
-schema.statics.findNotEmptyParentRecursively = async function(target: PageDocument): Promise<PageDocument | null> {
-  const parent = await this.findById(target.parent);
+// schema.statics.findNotEmptyParentByPathRecursively = async function(path: string): Promise<PageDocument | null> {
+// Find a page on the tree by path
+// Find not empty parent
+//   const parent = await this.findById(target.parent);
 
-  const shouldContinue = parent != null && parent.isEmpty;
+//   const shouldContinue = parent != null && parent.isEmpty;
 
-  if (shouldContinue) {
-    return this.findNotEmptyParentRecursively(parent);
-  }
+//   if (shouldContinue) {
+//     return this.findNotEmptyParentByPathRecursively(parent);
+//   }
 
-  return target;
-};
+//   return target;
+// };
 
 schema.statics.PageQueryBuilder = PageQueryBuilder as any; // mongoose does not support constructor type as statics attrs type