diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index 087302c4..ae57e65e 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -156,7 +156,7 @@ const Communities = () => { const saveCommunity = () => { - if (community.name.trim() ) { + if (community.name && community.num_houses > 0 && provinciaId && cantonId && districtId && community.phone ) { let _communities = [...communitiesList]; let _community = { ...community }; _community.province = provinciaId; @@ -234,13 +234,13 @@ const Communities = () => {
Comunidades de Viviendas
- - - - - - - + + + + + + + @@ -257,7 +257,7 @@ const Communities = () => { - onInputChange(e, 'name')} required autoFocus className={submitted && community.name === '' ? 'p-invalid' : ''} /> + onInputChange(e, 'name')} required autoFocus className={classNames({'p-invalid' : submitted && community.name === ''})} /> {submitted && community.name === '' && Nombre es requirido.} @@ -329,7 +329,7 @@ const Communities = () => { - + {submitted && codeHouses === '' && El código para las viviendas es requirido.}