fix validation error
This commit is contained in:
parent
a405dc9e13
commit
eb57faf826
1 changed files with 4 additions and 2 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue