- progress with cerating users form;
This commit is contained in:
@@ -13,6 +13,7 @@ import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import { storeSet } from '../../store';
|
||||
import { klona } from 'klona';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { isEmail } from '../../helpers/validators';
|
||||
|
||||
const Users = () => {
|
||||
const [isVisibleEditDialog, setIsVisibleEditDialog] = useState(false);
|
||||
@@ -45,7 +46,10 @@ const Users = () => {
|
||||
}
|
||||
|
||||
const saveEditDialog = () => {
|
||||
|
||||
const emptyValues = Object.values(newUserData).filter(v => isEmpty(v));
|
||||
if (isEmpty(emptyValues)) {
|
||||
console.log(newUserData)
|
||||
}
|
||||
}
|
||||
|
||||
const onChangeEditItem = (value, key) => {
|
||||
@@ -129,12 +133,13 @@ const Users = () => {
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.email) || isNil(newUserData.email) })}>{__('Email', 'gepafin')}*</label>
|
||||
<InputText value={newUserData.email}
|
||||
invalid={isEmpty(newUserData.email) || isNil(newUserData.email)}
|
||||
invalid={isEmpty(newUserData.email) || isNil(newUserData.email) || !isEmail(newUserData.email)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'email')}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.phoneNumber) || isNil(newUserData.phoneNumber) })}>{__('Telefono', 'gepafin')}</label>
|
||||
<InputText value={newUserData.phoneNumber}
|
||||
keyfilter="int"
|
||||
invalid={isEmpty(newUserData.phoneNumber) || isNil(newUserData.phoneNumber)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'phoneNumber')}/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user