From c4dcbfacd30f63aa0c6f090d773b850130d82d54 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Tue, 19 Jul 2022 18:28:41 -0600 Subject: [PATCH] agregar registro de inquilino --- web-ui/web-react/src/components/Inquilinos.js | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) 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 (
-
Inquilinos
- - - - - - - - +
Registrar inquilino
+
+
+
+ + +
+
+ + +
+
+ +