diff --git a/web-ui/web-react/src/components/InquilinosCompletar.js b/web-ui/web-react/src/components/InquilinosCompletar.js index 6cd88906..0c01aae5 100644 --- a/web-ui/web-react/src/components/InquilinosCompletar.js +++ b/web-ui/web-react/src/components/InquilinosCompletar.js @@ -1,13 +1,11 @@ -import { Button } from 'primereact/button'; +import { Button } from 'primereact/button' import { InputText } from 'primereact/inputtext' import React, { useState, useRef } from 'react' -import { Dropdown } from 'primereact/dropdown'; - -import { useCookies } from "react-cookie"; +import { Dropdown } from 'primereact/dropdown' +import { useCookies } from 'react-cookie' const Inquilinos = () => { - let emptyTenant = { _id: null, dni: '', @@ -23,21 +21,20 @@ const Inquilinos = () => { date_entry: new Date(), status: '1', status_text: '', - }; + } - const [tenant, setTenant] = useState(emptyTenant); - const [selectedTentants, setSelectedTenants] = useState(null); - const [globalFilter, setGlobalFilter] = useState(null); - const [deleteTenantDialog, setDeleteTenantDialog] = useState(false); - const [deleteTenantsDialog, setDeleteTenantsDialog,] = useState(false); - const [communitiesList, setCommunitiesList] = useState([]); - const [communityId, setCommunityId] = useState(null); - const [submitted, setSubmitted] = useState(false); - const toast = useRef(null); - const dt = useRef(null); + const [tenant, setTenant] = useState(emptyTenant) + const [selectedTentants, setSelectedTenants] = useState(null) + const [globalFilter, setGlobalFilter] = useState(null) + const [deleteTenantDialog, setDeleteTenantDialog] = useState(false) + const [deleteTenantsDialog, setDeleteTenantsDialog] = useState(false) + const [communitiesList, setCommunitiesList] = useState([]) + const [communityId, setCommunityId] = useState(null) + const [submitted, setSubmitted] = useState(false) - const [cookies, setCookie] = useCookies(); - const [changeStatusTenantDialog, setChangeStatusTenantDialog] = useState(false); + const [cookies, setCookie] = useCookies() + const [changeStatusTenantDialog, setChangeStatusTenantDialog] = + useState(false) function finalizarRegistro() { let data = { @@ -50,7 +47,7 @@ const Inquilinos = () => { password: document.getElementById('password').value, user_type: '3', status: '1', - }; + } fetch('http://localhost:3000/api/createUser', { method: 'POST', @@ -61,61 +58,65 @@ const Inquilinos = () => { }, }).then((response) => { if (response.ok) { - alert('Inquilino registrado correctamente'); + alert('Inquilino registrado correctamente') } else { - alert('Error al registrar inquilino'); + alert('Error al registrar inquilino') } - }); + }) } return ( -
-
-
-
Registrar Inquilino
-
-
- - +
+
+
+
Registrar Inquilino
+
+
+ +
-
- - +
+ +
-
- +
+
-
- +
+
-
- - -
-
- - + +
-
- ); -}; + ) +} -export default React.memo(Inquilinos); +export default React.memo(Inquilinos)