From c2bd6d6b33dc24c4321228add4fedfade93eb014 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 17 Mar 2024 10:15:01 +0000
Subject: refactor: Prepare for pagination by dropping querying bookmarks by id

---
 apps/web/components/dashboard/bookmarks/AddToListModal.tsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'apps/web/components/dashboard/bookmarks/AddToListModal.tsx')

diff --git a/apps/web/components/dashboard/bookmarks/AddToListModal.tsx b/apps/web/components/dashboard/bookmarks/AddToListModal.tsx
index 6242aa27..b8cce66d 100644
--- a/apps/web/components/dashboard/bookmarks/AddToListModal.tsx
+++ b/apps/web/components/dashboard/bookmarks/AddToListModal.tsx
@@ -52,7 +52,6 @@ export default function AddToListModal({
   const { data: lists, isPending: isFetchingListsPending } =
     api.lists.list.useQuery();
 
-  const listInvalidationFunction = api.useUtils().lists.get.invalidate;
   const bookmarksInvalidationFunction =
     api.useUtils().bookmarks.getBookmarks.invalidate;
 
@@ -62,8 +61,8 @@ export default function AddToListModal({
         toast({
           description: "List has been updated!",
         });
-        listInvalidationFunction({ listId: req.listId });
-        bookmarksInvalidationFunction();
+        setOpen(false);
+        bookmarksInvalidationFunction({ listId: req.listId });
       },
       onError: (e) => {
         if (e.data?.code == "BAD_REQUEST") {
-- 
cgit v1.2.3-70-g09d2

