aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/bookmarks
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-04-06 02:13:47 +0100
committerMohamedBassem <me@mbassem.com>2024-04-06 02:13:47 +0100
commit044659fd1ba2082491eed713dc72bafd696f0439 (patch)
treed597da0ae1165e6a2dc50387121ea079a607b8a3 /apps/web/components/dashboard/bookmarks
parent4cf990816817c009a512356373fdb1c4baa5e63b (diff)
downloadkarakeep-044659fd1ba2082491eed713dc72bafd696f0439.tar.zst
fix: Refresh the all tags page automatically when a tag is modified
Diffstat (limited to 'apps/web/components/dashboard/bookmarks')
-rw-r--r--apps/web/components/dashboard/bookmarks/TagsEditor.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx b/apps/web/components/dashboard/bookmarks/TagsEditor.tsx
index ecd6d29c..91294b2e 100644
--- a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx
+++ b/apps/web/components/dashboard/bookmarks/TagsEditor.tsx
@@ -17,16 +17,16 @@ interface EditableTag {
export function TagsEditor({ bookmark }: { bookmark: ZBookmark }) {
const demoMode = !!useClientConfig().demoMode;
- const bookmarkInvalidationFunction =
- api.useUtils().bookmarks.getBookmark.invalidate;
+ const apiUtils = api.useUtils();
const { mutate } = api.bookmarks.updateTags.useMutation({
onSuccess: () => {
toast({
description: "Tags has been updated!",
});
- bookmarkInvalidationFunction({ bookmarkId: bookmark.id });
- // TODO(bug) Invalidate the tag views as well
+ apiUtils.bookmarks.getBookmark.invalidate({ bookmarkId: bookmark.id });
+ apiUtils.tags.list.invalidate();
+ apiUtils.tags.get.invalidate();
},
onError: () => {
toast({