From 008016902e57e293dd0225c1bd35e597a88aecc9 Mon Sep 17 00:00:00 2001 From: Ritik Kumar <58480195+iamr-kumar@users.noreply.github.com> Date: Thu, 13 Jul 2023 01:59:13 +0530 Subject: [PATCH] fix: incomplete vercel api error message on org creation (#9875) * fix incomplete vercel api error message on org creation * remove specified type from vercelCreateDomain * have common error message for org domain registration --------- Co-authored-by: Leo Giovanetti --- apps/web/public/static/locales/en/common.json | 1 + .../organizations/components/CreateANewOrganizationForm.tsx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 6b692f484a..86338a8b08 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -1494,6 +1494,7 @@ "must_enter_team_name": "Must enter a team name", "team_url_required": "Must enter a team URL", "url_taken": "This URL is already taken", + "problem_registering_domain": "There was a problem with registering the subdomain, please try again or contact an administrator", "team_publish": "Publish team", "number_text_notifications": "Phone number (Text notifications)", "attendee_email_variable": "Attendee email", diff --git a/packages/features/ee/organizations/components/CreateANewOrganizationForm.tsx b/packages/features/ee/organizations/components/CreateANewOrganizationForm.tsx index 8aafdd782a..caeb2a50d9 100644 --- a/packages/features/ee/organizations/components/CreateANewOrganizationForm.tsx +++ b/packages/features/ee/organizations/components/CreateANewOrganizationForm.tsx @@ -178,6 +178,11 @@ export const CreateANewOrganizationForm = () => { }); } else if (err.message === "organization_url_taken") { newOrganizationFormMethods.setError("slug", { type: "custom", message: t("url_taken") }); + } else if (err.message === "domain_taken_team" || err.message === "domain_taken_project") { + newOrganizationFormMethods.setError("slug", { + type: "custom", + message: t("problem_registering_domain"), + }); } else { setServerErrorMessage(err.message); }