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.

Fix domain mutate

Tim Wilsone064ee431a45
diff --git a/apps/web/ui/modals/add-edit-domain-modal/index.tsx b/apps/web/ui/modals/add-edit-domain-modal/index.tsx
index 927e01775a..4d91e600f3 100644
--- a/apps/web/ui/modals/add-edit-domain-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-domain-modal/index.tsx
@@ -146,7 +146,11 @@ function AddEditDomainModal({
});
}
await Promise.all([
- mutate(`/api/domains?workspaceId=${workspaceId}`),
+ mutate(
+ (key) =>
+ typeof key === "string" &&
+ key.startsWith(`/api/domains?workspaceId=${workspaceId}`),
+ ),
mutate(
(key) =>
typeof key === "string" && key.startsWith("/api/links"),
diff --git a/apps/web/ui/modals/delete-domain-modal.tsx b/apps/web/ui/modals/delete-domain-modal.tsx
index 5516f51c2b..6cf20ba204 100644
--- a/apps/web/ui/modals/delete-domain-modal.tsx
+++ b/apps/web/ui/modals/delete-domain-modal.tsx
@@ -49,7 +49,11 @@ function DeleteDomainModal({
method: "DELETE",
}).then(async (res) => {
if (res.status === 200) {
- await mutate(`/api/domains?workspaceId=${id}`);
+ await mutate(
+ (key) =>
+ typeof key === "string" &&
+ key.startsWith(`/api/domains?workspaceId=${id}`),
+ );
setShowDeleteDomainModal(false);
toast.success("Successfully deleted domain!");
} else {