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.

Update utm-templates-button.tsx

Tim Wilson86ae61b33dab
diff --git a/apps/web/ui/modals/link-builder/utm-templates-button.tsx b/apps/web/ui/modals/link-builder/utm-templates-button.tsx
index a656f7169f..17953552c2 100644
--- a/apps/web/ui/modals/link-builder/utm-templates-button.tsx
+++ b/apps/web/ui/modals/link-builder/utm-templates-button.tsx
@@ -156,7 +156,11 @@ function SaveUTMTemplateForm({ onSuccess }: { onSuccess: () => void }) {
}),
},
);
- if (!res.ok) throw new Error("UTM template save request failed");
+ if (!res.ok) {
+ const { error } = await res.json();
+ toast.error(error.message);
+ return;
+ }
mutate(`/api/utm-templates?workspaceId=${workspaceId}`);
toast.success("Template saved successfully");