fix validation error

This commit is contained in:
Christie Molloy 2020-10-05 15:45:06 -04:00
parent a405dc9e13
commit eb57faf826

View file

@ -41,8 +41,9 @@ export const GroupsCreateModal = ({
}; };
const submitForm = async () => { const submitForm = async () => {
if (await form.trigger()) {
try { try {
await httpClient.doPost(`/admin/realms/${realm}/groups`, { httpClient.doPost(`/admin/realms/${realm}/groups`, {
name: createGroupName, name: createGroupName,
}); });
setIsCreateModalOpen(false); setIsCreateModalOpen(false);
@ -51,7 +52,8 @@ export const GroupsCreateModal = ({
} catch (error) { } catch (error) {
add(`${t("couldNotCreateGroup")} ': '${error}'`, AlertVariant.danger); add(`${t("couldNotCreateGroup")} ': '${error}'`, AlertVariant.danger);
} }
}; }
};
return ( return (
<React.Fragment> <React.Fragment>