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