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 <hello@leog.me>
pull/10113/head^2
Ritik Kumar 2023-07-13 01:59:13 +05:30 committed by GitHub
parent 9f33d85903
commit 008016902e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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",

View File

@ -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);
}