establecer primero constantes para obtener comunidades

This commit is contained in:
Mariela 2022-07-24 23:53:28 -06:00
parent 296f7fe90b
commit 1629edc32a
3 changed files with 8 additions and 36 deletions

View File

@ -26,6 +26,9 @@ const AdministradoresComunidad = () => {
const [deleteAdminsCommunitiesDialog, setDeleteAdminsCommunitiesDialog] = useState(false);
const toast = useRef(null);
const dt = useRef(null);
const [communitiesList, setCommunitiesList] = useState([]);
const [communityId, setCommunityId] = useState([]);
let emptyAdminCommunity = {
_id: null,
@ -38,7 +41,7 @@ const AdministradoresComunidad = () => {
community_id: '',
community_name: '',
user_type: '2',
status: ''
status: '1'
};
async function listaAdmin() {
@ -152,9 +155,6 @@ const AdministradoresComunidad = () => {
setDeleteAdminCommunityDialog(true);
}
const confirmDeleteSelected = () => {
setDeleteAdminsCommunitiesDialog(true);
}
const actionsAdminCommunity = (rowData) => {
return (
@ -164,35 +164,6 @@ const AdministradoresComunidad = () => {
);
}
const leftToolbarTemplate = () => {
return (
<React.Fragment>
<div className="my-2">
<Button label="Eliminar" icon="pi pi-trash" className="p-button-danger" onClick={confirmDeleteSelected} disabled={!selectedAdminsCommunities || !selectedAdminsCommunities.length} />
</div>
</React.Fragment>
)
}
const rightToolbarTemplate = () => {
return (
<React.Fragment>
<Button label="Exportar" icon="pi pi-upload" className="p-button-help" />
</React.Fragment>
)
}
const header = (
<div className="flex flex-column md:flex-row md:justify-content-between md:align-items-center">
<h5 className="m-0">Administradores de Comunidades</h5>
<span className="block mt-2 md:mt-0 p-input-icon-left">
<i className="pi pi-search" />
<InputText type="search" onInput={(e) => setGlobalFilter(e.target.value)} placeholder="Buscar..." />
</span>
</div>
);
const deleteAdminCommunityDialogFooter = (
<>
<Button label="No" icon="pi pi-times" className="p-button-text" onClick={hideDeleteAdminCommunityDialog} />
@ -346,9 +317,10 @@ const AdministradoresComunidad = () => {
)
}
const header = (
<div className="flex flex-column md:flex-row md:justify-content-between md:align-items-center">
<h5 className="m-0">Administradores del sistema <i class="fal fa-user"></i></h5>
<h5 className="m-0">Administradores de Comunidades</h5>
<span className="block mt-2 md:mt-0 p-input-icon-left">
<i className="pi pi-search" />
<InputText type="search" onInput={(e) => setGlobalFilter(e.target.value)} placeholder="Buscar..." />

View File

@ -35,7 +35,7 @@ const AdministradoresSistema = () => {
phone: '',
password: '',
user_type: '1',
status: ''
status: '1'
};
async function fetchP() {

View File

@ -24,7 +24,7 @@ const Communities = () => {
district: districtId,
phone: '',
num_houses: 0,
status: 'activo',
status: '1',
date_entry: new Date(),
houses: [],
};