establecer primero constantes para obtener comunidades
This commit is contained in:
parent
296f7fe90b
commit
1629edc32a
|
@ -26,6 +26,9 @@ const AdministradoresComunidad = () => {
|
||||||
const [deleteAdminsCommunitiesDialog, setDeleteAdminsCommunitiesDialog] = useState(false);
|
const [deleteAdminsCommunitiesDialog, setDeleteAdminsCommunitiesDialog] = useState(false);
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
const dt = useRef(null);
|
const dt = useRef(null);
|
||||||
|
const [communitiesList, setCommunitiesList] = useState([]);
|
||||||
|
const [communityId, setCommunityId] = useState([]);
|
||||||
|
|
||||||
|
|
||||||
let emptyAdminCommunity = {
|
let emptyAdminCommunity = {
|
||||||
_id: null,
|
_id: null,
|
||||||
|
@ -38,7 +41,7 @@ const AdministradoresComunidad = () => {
|
||||||
community_id: '',
|
community_id: '',
|
||||||
community_name: '',
|
community_name: '',
|
||||||
user_type: '2',
|
user_type: '2',
|
||||||
status: ''
|
status: '1'
|
||||||
};
|
};
|
||||||
|
|
||||||
async function listaAdmin() {
|
async function listaAdmin() {
|
||||||
|
@ -152,9 +155,6 @@ const AdministradoresComunidad = () => {
|
||||||
setDeleteAdminCommunityDialog(true);
|
setDeleteAdminCommunityDialog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmDeleteSelected = () => {
|
|
||||||
setDeleteAdminsCommunitiesDialog(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
const actionsAdminCommunity = (rowData) => {
|
const actionsAdminCommunity = (rowData) => {
|
||||||
return (
|
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 = (
|
const deleteAdminCommunityDialogFooter = (
|
||||||
<>
|
<>
|
||||||
<Button label="No" icon="pi pi-times" className="p-button-text" onClick={hideDeleteAdminCommunityDialog} />
|
<Button label="No" icon="pi pi-times" className="p-button-text" onClick={hideDeleteAdminCommunityDialog} />
|
||||||
|
@ -346,9 +317,10 @@ const AdministradoresComunidad = () => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const header = (
|
const header = (
|
||||||
<div className="flex flex-column md:flex-row md:justify-content-between md:align-items-center">
|
<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">
|
<span className="block mt-2 md:mt-0 p-input-icon-left">
|
||||||
<i className="pi pi-search" />
|
<i className="pi pi-search" />
|
||||||
<InputText type="search" onInput={(e) => setGlobalFilter(e.target.value)} placeholder="Buscar..." />
|
<InputText type="search" onInput={(e) => setGlobalFilter(e.target.value)} placeholder="Buscar..." />
|
||||||
|
|
|
@ -35,7 +35,7 @@ const AdministradoresSistema = () => {
|
||||||
phone: '',
|
phone: '',
|
||||||
password: '',
|
password: '',
|
||||||
user_type: '1',
|
user_type: '1',
|
||||||
status: ''
|
status: '1'
|
||||||
};
|
};
|
||||||
|
|
||||||
async function fetchP() {
|
async function fetchP() {
|
||||||
|
|
|
@ -24,7 +24,7 @@ const Communities = () => {
|
||||||
district: districtId,
|
district: districtId,
|
||||||
phone: '',
|
phone: '',
|
||||||
num_houses: 0,
|
num_houses: 0,
|
||||||
status: 'activo',
|
status: '1',
|
||||||
date_entry: new Date(),
|
date_entry: new Date(),
|
||||||
houses: [],
|
houses: [],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue