Răsfoiți Sursa

add missing populate for ancestor page

Futa Arai 2 ani în urmă
părinte
comite
d4d51d4319
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  1. 1 0
      apps/app/src/pages/[[...path]].page.tsx

+ 1 - 0
apps/app/src/pages/[[...path]].page.tsx

@@ -461,6 +461,7 @@ async function injectPageData(context: GetServerSidePropsContext, props: Props):
     // apply parent page grant, without groups that user isn't related to
     // apply parent page grant, without groups that user isn't related to
     const ancestor = await Page.findAncestorByPathAndViewer(currentPathname, user);
     const ancestor = await Page.findAncestorByPathAndViewer(currentPathname, user);
     if (ancestor != null) {
     if (ancestor != null) {
+      ancestor.populate('grantedGroups.item');
       const userRelatedGrantedGroups = (await pageService.getUserRelatedGrantedGroups(ancestor, user)).map((group) => {
       const userRelatedGrantedGroups = (await pageService.getUserRelatedGrantedGroups(ancestor, user)).map((group) => {
         if (isPopulated(group.item)) {
         if (isPopulated(group.item)) {
           return {
           return {