eliminar inquilinos varios
This commit is contained in:
parent
b9d79c8402
commit
ad4d194759
|
@ -231,7 +231,24 @@ const Inquilinos = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteSelectedTenants = () => {
|
const deleteSelectedTenants = () => {
|
||||||
let _tenants = tenants.filter((val) => !selectedTentants.includes(val))
|
let _tenants = tenants.filter(
|
||||||
|
(val) => !selectedTentants.includes(val)
|
||||||
|
);
|
||||||
|
selectedTentants.map((item) => {
|
||||||
|
let _tenant = {
|
||||||
|
community_id: item.community_id,
|
||||||
|
number_house: item.number_house
|
||||||
|
};
|
||||||
|
fetch('http://localhost:4000/user/deleteTenant/' + item._id, {
|
||||||
|
cache: 'no-cache',
|
||||||
|
method: 'PUT',
|
||||||
|
body: JSON.stringify(_tenant),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
setTenants(_tenants)
|
setTenants(_tenants)
|
||||||
setDeleteTenantsDialog(false)
|
setDeleteTenantsDialog(false)
|
||||||
setSelectedTenants(null)
|
setSelectedTenants(null)
|
||||||
|
|
Loading…
Reference in New Issue