2
0
Эх сурвалжийг харах

Implemented findParent method

Taichi Masuyama 4 жил өмнө
parent
commit
2533c514eb

+ 4 - 0
packages/app/src/server/models/page.ts

@@ -999,6 +999,10 @@ schema.statics.removeEmptyPages = async function(pageIdsToNotRemove: ObjectIdLik
   });
 };
 
+schema.statics.findParent = async function(pageId): Promise<PageDocument | null> {
+  return this.findOne({ _id: pageId });
+};
+
 schema.statics.PageQueryBuilder = PageQueryBuilder as any; // mongoose does not support constructor type as statics attrs type
 
 export function generateGrantCondition(