fix: Show proper error in case the team can't be published because requestedSlug isn't set (#14283)

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Hariom Balhara
2024-04-02 12:44:39 +00:00
committed by GitHub
co-authored by Udit Takkar
parent 6283535d6a
commit 2cbf9e1ac8
3 changed files with 3 additions and 5 deletions
@@ -68,8 +68,7 @@ const OrgForm = ({
router.replace(`/settings/admin/organizations`);
},
onError: (err) => {
console.error(err.message);
showToast(t("org_error_processing"), "error");
showToast(err.message, "error");
},
});
@@ -45,8 +45,7 @@ function AdminOrgTable() {
});
},
onError: (err) => {
console.error(err.message);
showToast(t("org_error_processing"), "error");
showToast(err.message, "error");
},
});
@@ -108,7 +108,7 @@ async function throwIfSlugConflicts({ id, slug }: { id: number; slug: string })
// If foundOrg isn't same as the org being edited
if (foundOrg.id !== id) {
throw new HttpError({
message: "Organization with same slug already exists",
message: "Organization or a Team with same slug already exists",
statusCode: 400,
});
}