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 attribute-referring-partner-modal.tsx

Kiran K60b1491841aa
diff --git a/apps/web/lib/partner-referrals/components/attribute-referring-partner-modal.tsx b/apps/web/lib/partner-referrals/components/attribute-referring-partner-modal.tsx
index c5f4530bb1..b5c9f62786 100644
--- a/apps/web/lib/partner-referrals/components/attribute-referring-partner-modal.tsx
+++ b/apps/web/lib/partner-referrals/components/attribute-referring-partner-modal.tsx
@@ -1,5 +1,6 @@
"use client";
+import { parseActionError } from "@/lib/actions/parse-action-errors";
import { mutatePrefix } from "@/lib/swr/mutate";
import useWorkspace from "@/lib/swr/use-workspace";
import { EnrolledPartnerProps } from "@/lib/types";
@@ -46,7 +47,7 @@ function AttributeReferringPartnerModal({
setShowModal(false);
},
onError({ error }) {
- toast.error(error.serverError);
+ toast.error(parseActionError(error));
},
},
);
@@ -135,7 +136,7 @@ function AttributeReferringPartnerModal({
onClick={onSubmit}
variant="primary"
text="Attribute partner"
- disabled={!referredByPartnerId}
+ disabled={!workspaceId || !referredByPartnerId || isPending}
loading={isPending}
className="h-8 w-fit px-3"
/>