This commit is contained in:
parent
ca350380fb
commit
cf695626a6
2 changed files with 6 additions and 2 deletions
|
@ -78,7 +78,11 @@ export const ScopeForm = ({ clientScope, save }: ScopeFormProps) => {
|
|||
helperTextInvalid={t("common:required")}
|
||||
>
|
||||
<TextInput
|
||||
ref={register({ required: true })}
|
||||
ref={register({
|
||||
required: true,
|
||||
validate: (value: string) =>
|
||||
!!value.trim() || t("common:required").toString(),
|
||||
})}
|
||||
type="text"
|
||||
id="kc-name"
|
||||
name="name"
|
||||
|
|
|
@ -106,7 +106,7 @@ export default function ClientScopeForm() {
|
|||
|
||||
const save = async (clientScopes: ClientScopeDefaultOptionalType) => {
|
||||
try {
|
||||
clientScopes.name = clientScopes.name?.trim();
|
||||
clientScopes.name = clientScopes.name?.trim().replace(/ /g, "_");
|
||||
clientScopes = convertFormValuesToObject(
|
||||
clientScopes
|
||||
) as ClientScopeDefaultOptionalType;
|
||||
|
|
Loading…
Reference in a new issue