obtener listado de comunidades para registrar inquilino
This commit is contained in:
parent
462d84d1ea
commit
4c812dce5d
|
@ -2,6 +2,17 @@ import { InputText } from 'primereact/inputtext'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
const Inquilinos = () => {
|
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() {
|
function registrarInquilino() {
|
||||||
let data = {
|
let data = {
|
||||||
email: document.getElementById('correo_electronico').value,
|
email: document.getElementById('correo_electronico').value,
|
||||||
|
|
Loading…
Reference in New Issue