obtener listado de comunidades para registrar inquilino

This commit is contained in:
Eduardo Quiros 2022-07-19 19:22:50 -06:00
parent 462d84d1ea
commit 4c812dce5d
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 11 additions and 0 deletions

View File

@ -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,