Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

mutate links when delete tag

Steven Teyd30593e7b468
diff --git a/apps/web/ui/links/link-filters.tsx b/apps/web/ui/links/link-filters.tsx
index 74bdbf26f1..72961a9d0f 100644
--- a/apps/web/ui/links/link-filters.tsx
+++ b/apps/web/ui/links/link-filters.tsx
@@ -437,7 +437,14 @@ const TagPopover = ({ tag, count }: { tag: TagProps; count: number }) => {
method: "DELETE",
}).then(async (res) => {
if (res.ok) {
- await mutate(`/api/tags?projectSlug=${slug}`);
+ await Promise.all([
+ mutate(`/api/tags?projectSlug=${slug}`),
+ mutate(
+ (key) => typeof key === "string" && key.startsWith("/api/links"),
+ undefined,
+ { revalidate: true },
+ ),
+ ]);
toast.success("Tag deleted");
} else {
toast.error("Something went wrong");