diff --git a/web-ui/web-react/src/components/Inquilinos.js b/web-ui/web-react/src/components/Inquilinos.js index 48071ee0..5f63745b 100644 --- a/web-ui/web-react/src/components/Inquilinos.js +++ b/web-ui/web-react/src/components/Inquilinos.js @@ -6,24 +6,46 @@ const Inquilinos = () => { function registrarInquilino() { let data = { email: document.getElementById('correo_electronico').value, - user_type: '1', //1 es admin TODO: cambiar a otro valor + user_type: '3', status: '1', } + + fetch('http://localhost:3000/api/createUser', { + method: 'POST', + cache: 'no-cache', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }).then((response) => { + if (response.ok) { + alert('Inquilino registrado correctamente') + } else { + alert('Error al registrar inquilino') + } + }) } return (