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.

Add setError

Tim Wilson436f332ee14d
diff --git a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/application/form.tsx b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/application/form.tsx
index 784f6b5b62..e94fc33abd 100644
--- a/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/application/form.tsx
+++ b/apps/web/app/partners.dub.co/(apply)/apply/[programSlug]/application/form.tsx
@@ -32,6 +32,7 @@ export function ProgramApplicationForm({
const {
register,
handleSubmit,
+ setError,
formState: { errors, isSubmitting, isSubmitSuccessful },
} = useForm<FormData>({ defaultValues });
@@ -51,6 +52,9 @@ export function ProgramApplicationForm({
toast.error(
response?.data?.message ?? "Failed to submit application",
);
+ setError("root.serverError", {
+ message: "Failed to submit application. Please try again.",
+ });
return;
}