From 044659fd1ba2082491eed713dc72bafd696f0439 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 6 Apr 2024 02:13:47 +0100 Subject: fix: Refresh the all tags page automatically when a tag is modified --- apps/web/components/dashboard/bookmarks/TagsEditor.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/web/components/dashboard/bookmarks') 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({ -- cgit v1.2.3-70-g09d2