فهرست منبع

add latestRevisionId to IPageInfoForEntity

Yuki Takei 5 ماه پیش
والد
کامیت
b906c22703
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 3 0
      apps/app/src/server/service/page/index.ts
  2. 1 0
      packages/core/src/interfaces/page.ts

+ 3 - 0
apps/app/src/server/service/page/index.ts

@@ -2602,6 +2602,9 @@ class PageService implements IPageService {
       contentAge: page.getContentAge(),
       descendantCount: page.descendantCount,
       commentCount: page.commentCount,
+      // the page must have a revision if it is not empty
+      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      latestRevisionId: getIdStringForRef(page.revision!),
     };
 
     return infoForEntity;

+ 1 - 0
packages/core/src/interfaces/page.ts

@@ -110,6 +110,7 @@ export type IPageInfoForEntity = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {
   contentAge: number;
   descendantCount: number;
   commentCount: number;
+  latestRevisionId: Ref<IRevision>;
 };
 
 export type IPageInfoForOperation = IPageInfoForEntity & {