Explorar o código

BugFix: isBookmarked type

Yuki Takei %!s(int64=4) %!d(string=hai) anos
pai
achega
8ff46b67d2
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      packages/app/src/server/service/page.ts

+ 3 - 3
packages/app/src/server/service/page.ts

@@ -266,9 +266,9 @@ class PageService {
       };
     }
 
-    const isBookmarked = await Bookmark.findByPageIdAndUserId(pageId, user._id);
-    const isLiked = page.isLiked(user);
-    const isAbleToDeleteCompletely = this.canDeleteCompletely((page.creator as IUserHasId)?._id, user);
+    const isBookmarked: boolean = (await Bookmark.findByPageIdAndUserId(pageId, user._id)) != null;
+    const isLiked: boolean = page.isLiked(user);
+    const isAbleToDeleteCompletely: boolean = this.canDeleteCompletely((page.creator as IUserHasId)?._id, user);
 
     const subscription = await Subscription.findByUserIdAndTargetId(user._id, pageId);