evitar que se muestren los eliminados

This commit is contained in:
Mariela 2022-08-01 01:30:38 -06:00
parent 443b09e8e3
commit b213900733
1 changed files with 20 additions and 10 deletions

View File

@ -67,6 +67,10 @@ const AreasComunes = () => {
}
})
}
data = data.filter(
(val) => val.status != -1,
)
setCommonAreaList(data);
});
}
@ -98,6 +102,9 @@ const AreasComunes = () => {
let _common_areas = commonAreaList.filter(
(val) => val._id !== commonArea._id,
);
_common_areas = _common_areas.filter(
(val) => val.status != -1,
)
setCommonAreaList(_common_areas);
setDeleteCommonAreaDialog(false);
setCommonArea(emptyCommonArea);
@ -121,15 +128,18 @@ const AreasComunes = () => {
let _commonareas = commonAreaList.filter(
(val) => !selectedCommonAreas.includes(val),
);
/* selectedCommunities.map((item) => {
fetch('http://localhost:4000/user/deleteCommunity/' + item._id, {
selectedCommonAreas.map((item) => {
fetch('http://localhost:4000/commonArea/deleteCommonArea/' + item._id, {
cache: 'no-cache',
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
})*/
});
_common_areas = _common_areas.filter(
(val) => val.status != -1,
)
setCommonAreaList(_commonareas);
setDeleteCommonAreasDialog(false);
setSelectedCommonAreas(null);