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")}
|
helperTextInvalid={t("common:required")}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
ref={register({ required: true })}
|
ref={register({
|
||||||
|
required: true,
|
||||||
|
validate: (value: string) =>
|
||||||
|
!!value.trim() || t("common:required").toString(),
|
||||||
|
})}
|
||||||
type="text"
|
type="text"
|
||||||
id="kc-name"
|
id="kc-name"
|
||||||
name="name"
|
name="name"
|
||||||
|
|
|
@ -106,7 +106,7 @@ export default function ClientScopeForm() {
|
||||||
|
|
||||||
const save = async (clientScopes: ClientScopeDefaultOptionalType) => {
|
const save = async (clientScopes: ClientScopeDefaultOptionalType) => {
|
||||||
try {
|
try {
|
||||||
clientScopes.name = clientScopes.name?.trim();
|
clientScopes.name = clientScopes.name?.trim().replace(/ /g, "_");
|
||||||
clientScopes = convertFormValuesToObject(
|
clientScopes = convertFormValuesToObject(
|
||||||
clientScopes
|
clientScopes
|
||||||
) as ClientScopeDefaultOptionalType;
|
) as ClientScopeDefaultOptionalType;
|
||||||
|
|
Loading…
Reference in a new issue