From 4c812dce5d2a93a06f75a141e6a79109c39aecc7 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Tue, 19 Jul 2022 19:22:50 -0600 Subject: [PATCH] obtener listado de comunidades para registrar inquilino --- web-ui/web-react/src/components/Inquilinos.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web-ui/web-react/src/components/Inquilinos.js b/web-ui/web-react/src/components/Inquilinos.js index 10e98ac2..74844678 100644 --- a/web-ui/web-react/src/components/Inquilinos.js +++ b/web-ui/web-react/src/components/Inquilinos.js @@ -2,6 +2,17 @@ import { InputText } from 'primereact/inputtext' import React, { useEffect, useState } from 'react' const Inquilinos = () => { + const [communitiesList, setCommunitiesList] = useState([]); + const communityIdList = communitiesList.map(community => community.id); + async function getCommunites() { + let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' }); + let list = await response.json(); + setCommunitiesList(list.message); + } + + useEffect(() => { + getCommunites(); + }, []) function registrarInquilino() { let data = { email: document.getElementById('correo_electronico').value,