diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-27 17:24:46 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-03-27 17:25:03 +0000 |
| commit | 6e90035fa811180a59465b5e79987bafef302d59 (patch) | |
| tree | 584ae8a76702aed826db269f719efd046ba20a01 /apps/web/components/dashboard | |
| parent | e8628b586181ea99980b0beafd9976cabfdd077e (diff) | |
| download | karakeep-6e90035fa811180a59465b5e79987bafef302d59.tar.zst | |
fix: Refresh the search cache when a bookmark is deleted. Fixes #26
Diffstat (limited to 'apps/web/components/dashboard')
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx index a639b949..e95ec9a2 100644 --- a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx +++ b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx @@ -52,6 +52,9 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) { const invalidateBookmarkCache = api.useUtils().bookmarks.getBookmark.invalidate; + const invalidateSearchCache = + api.useUtils().bookmarks.searchBookmarks.invalidate; + const onError = () => { toast({ variant: "destructive", @@ -68,6 +71,7 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) { onError, onSettled: () => { invalidateAllBookmarksCache(); + invalidateSearchCache(); }, }); @@ -81,6 +85,7 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) { onSettled: () => { invalidateBookmarkCache({ bookmarkId: bookmark.id }); invalidateAllBookmarksCache(); + invalidateSearchCache(); }, }); |
