jam411 3 лет назад
Родитель
Сommit
2f81eb5837

+ 6 - 3
packages/app/src/interfaces/bookmark-info.ts

@@ -1,6 +1,9 @@
-import { IPageHasId } from '~/interfaces/page';
+import { Ref } from '@growi/core';
+
 import { IUser } from '~/interfaces/user';
 
+import { IPage } from './page';
+
 export type IBookmarkInfo = {
   sumOfBookmarks: number;
   isBookmarked: boolean,
@@ -9,7 +12,7 @@ export type IBookmarkInfo = {
 
 export type BookmarkListPage = {
   _id: string,
-  page: IPageHasId,
-  user: string,
+  page: Populated<IPage>,
+  user: Ref<IUser>,
   createdAt: Date,
 }

+ 3 - 3
packages/app/src/pages/[[...path]].page.tsx

@@ -337,7 +337,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
           <Comments pageId={pageId} />
           {/* )} */}
           {/* TODO: Create UsersHomePageFooter conponent */}
-          { (pageWithMeta != null && isUsersHomePage(pageWithMeta.data.path)) && (
+          { (pageWithMeta != null && isUsersHomePage(pageWithMeta?.data.path)) && (
             <div className="container-lg user-page-footer py-5">
               <div className="grw-user-page-list-m d-edit-none">
                 <h2 id="bookmarks-list" className="grw-user-page-header border-bottom pb-2 mb-3">
@@ -346,7 +346,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
                 </h2>
                 <div id="user-bookmark-list" className="page-list">
                   <div className="page-list-container">
-                    <BookmarkList userId={pageWithMeta.data.creator._id} />
+                    <BookmarkList userId={pageWithMeta?.data.creator._id} />
                   </div>
                 </div>
               </div>
@@ -359,7 +359,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
                 </h2>
                 <div id="user-created-list" className="page-list">
                   <div className="page-list-container">
-                    <RecentCreated userId={pageWithMeta.data.creator._id} />
+                    <RecentCreated userId={pageWithMeta?.data.creator._id} />
                   </div>
                 </div>
               </div>