refactor the Form Input field name from adminPassword to InputFieldPassword

This commit is contained in:
dorj222 2023-02-07 11:53:23 +01:00
parent 170f367538
commit 3711588909

View file

@ -76,7 +76,7 @@ export const TextField: FC<TextFieldProps> = ({
}; };
useEffect(() => { useEffect(() => {
form.setFieldsValue({ adminPassword: value }); form.setFieldsValue({ inputFieldPassword: value });
}, [value]); }, [value]);
// if you blur a required field with an empty value, restore its original value in state (parent's state), if an onChange from parent is available. // if you blur a required field with an empty value, restore its original value in state (parent's state), if an onChange from parent is available.
@ -172,11 +172,11 @@ export const TextField: FC<TextFieldProps> = ({
<Form <Form
name="basic" name="basic"
form={form} form={form}
initialValues={{ adminPassword: value }} initialValues={{ inputFieldPassword: value }}
style={{ width: '100%' }} style={{ width: '100%' }}
> >
<Form.Item <Form.Item
name="adminPassword" name="inputFieldPassword"
rules={[ rules={[
{ min: 8, message: '- minimum 8 characters' }, { min: 8, message: '- minimum 8 characters' },
{ max: 192, message: '- maximum 192 characters' }, { max: 192, message: '- maximum 192 characters' },