convertir funciones a arrow functions

This commit is contained in:
Eduardo Quiros 2022-08-03 21:01:34 -06:00
parent 95b08d9b53
commit aa95b52c0d
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 16 additions and 20 deletions

View File

@ -56,7 +56,7 @@ const Inquilinos = () => {
async function tenantsList() {
await fetch(`http://localhost:4000/user/findTenants/${cookies.community_id}`, { method: 'GET' })
.then((response) => response.json())
.then(data => data.message.filter)
.then(data => data.message)
.then(data => {
data = data.filter(
(val) => val.status != -1,
@ -181,25 +181,21 @@ const Inquilinos = () => {
'Content-Type': 'application/json'
}
})
.then(
function (response) {
if (response.status != 201)
console.log('Ocurrió un error con el servicio: ' + response.status);
else
return response.json();
}
)
.then(
function (response) {
setChangeStatusTenantDialog(false);
toast.current.show({
severity: 'success',
summary: 'Éxito',
detail: 'Inquilino Actualizado',
life: 3000,
});
}
)
.then((response) => {
if(response.status != 201)
console.log('Ocurrió un error con el servicio: ' + response.status);
else
return response.json();
})
.then((response) => {
setChangeStatusTenantDialog(false);
toast.current.show({
severity: 'success',
summary: 'Éxito',
detail: 'Inquilino Actualizado',
life: 3000,
});
})
.catch(
err => console.log('Ocurrió un error con el fetch', err)
);