From 7c04276bacf6e9ecc0cce4a2ece7a25dc8e5deaa Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 20 Feb 2024 14:05:53 +0000
Subject: ui: hydrate the react query cache in the client side components

---
 packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx')

diff --git a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
index 0afb42bd..44495f1f 100644
--- a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
@@ -14,10 +14,12 @@ export default async function Bookmarks({
     redirect("/");
   }
 
-  const bookmarks = await api.bookmarks.getBookmarks({
+  const query = {
     favourited,
     archived,
-  });
+  };
+
+  const bookmarks = await api.bookmarks.getBookmarks(query);
 
   // TODO: This needs to be polished
   return (
@@ -27,7 +29,7 @@ export default async function Bookmarks({
         {bookmarks.bookmarks.length == 0 ? (
           "No bookmarks"
         ) : (
-          <BookmarksGrid bookmarks={bookmarks.bookmarks} />
+          <BookmarksGrid query={query} bookmarks={bookmarks.bookmarks} />
         )}
       </div>
     </>
-- 
cgit v1.2.3-70-g09d2

