set list inquilinos
This commit is contained in:
parent
72ea9d2033
commit
305a343936
|
@ -1,10 +1,40 @@
|
||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
import { Dropdown } from 'primereact/dropdown';
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
import { InputText } from 'primereact/inputtext'
|
import { InputText } from 'primereact/inputtext'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState, useRef } from 'react'
|
||||||
|
import { DataTable } from 'primereact/datatable';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { Toast } from 'primereact/toast';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
const Inquilinos = () => {
|
const Inquilinos = () => {
|
||||||
const [communitiesList, setCommunitiesList] = useState([]);
|
const [communitiesList, setCommunitiesList] = useState([]);
|
||||||
|
const [tenants, setTenants] = useState([]);
|
||||||
|
|
||||||
|
const [tenant, setTenant] = useState(emptyTenant);
|
||||||
|
|
||||||
|
let emptyTenant = {
|
||||||
|
_id: null,
|
||||||
|
dni: '',
|
||||||
|
name: '',
|
||||||
|
last_name: '',
|
||||||
|
email: '',
|
||||||
|
phone: '',
|
||||||
|
password: '',
|
||||||
|
user_type: '1',
|
||||||
|
community_id: '',
|
||||||
|
community_name: '',
|
||||||
|
number_house: '',
|
||||||
|
status: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function getTenants() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const communityIdList = communitiesList.map(community => community.id);
|
const communityIdList = communitiesList.map(community => community.id);
|
||||||
async function getCommunites() {
|
async function getCommunites() {
|
||||||
let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' });
|
let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' });
|
||||||
|
@ -53,7 +83,7 @@ const Inquilinos = () => {
|
||||||
<label htmlFor="numero_vivienda">Número de Vivienda</label>
|
<label htmlFor="numero_vivienda">Número de Vivienda</label>
|
||||||
<Dropdown id="numero_vivienda" value={communityIdList[0]} options={communitiesList} />
|
<Dropdown id="numero_vivienda" value={communityIdList[0]} options={communitiesList} />
|
||||||
</div>
|
</div>
|
||||||
<Button label="Registrar" onClick={registrarInquilino} />
|
<Button label="Registrar" onClick={registrarInquilino} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue