mirror of
https://github.com/logto-io/logto.git
synced 2025-03-31 22:51:25 -05:00
refactor(console): add error state to create role and permission form (#2978)
This commit is contained in:
parent
993298792d
commit
3f1faf4784
2 changed files with 4 additions and 1 deletions
|
@ -86,6 +86,7 @@ const CreatePermissionModal = ({ resourceId, onClose }: Props) => {
|
|||
<TextInput
|
||||
placeholder={t('api_resource_details.permission.description_placeholder')}
|
||||
{...register('description', { required: true })}
|
||||
hasError={Boolean(errors.description)}
|
||||
/>
|
||||
</FormField>
|
||||
</form>
|
||||
|
|
|
@ -28,7 +28,7 @@ const CreateRoleForm = ({ onClose }: Props) => {
|
|||
control,
|
||||
handleSubmit,
|
||||
register,
|
||||
formState: { isSubmitting },
|
||||
formState: { isSubmitting, errors },
|
||||
} = useForm<CreateRoleFormData>();
|
||||
|
||||
const api = useApi();
|
||||
|
@ -72,12 +72,14 @@ const CreateRoleForm = ({ onClose }: Props) => {
|
|||
autoFocus
|
||||
{...register('name', { required: true })}
|
||||
placeholder={t('roles.role_name_placeholder')}
|
||||
hasError={Boolean(errors.name)}
|
||||
/>
|
||||
</FormField>
|
||||
<FormField isRequired title="roles.role_description">
|
||||
<TextInput
|
||||
{...register('description', { required: true })}
|
||||
placeholder={t('roles.role_description_placeholder')}
|
||||
hasError={Boolean(errors.description)}
|
||||
/>
|
||||
</FormField>
|
||||
<FormField title="roles.assign_permissions">
|
||||
|
|
Loading…
Add table
Reference in a new issue