From ad16f8759dd001b960a252985ae04897da0faa1d Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Thu, 1 Sep 2022 10:25:44 -0600 Subject: [PATCH] switch to arrow functions --- .../web-react/src/components/ComunidadViviendas.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index f80f1157..cf278fc2 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -93,7 +93,7 @@ const Communities = () => { async function fillCantons() { const resJson = await getCantons(); - const cantones = await resJson.filter(function(i, n) { + const cantones = await resJson.filter((i, n) => { return i.parentCode === provinciaId; }); setCantonsList(await cantones); @@ -108,7 +108,7 @@ const Communities = () => { async function fillDistricts() { const resJson = await getDistricts(); - const districts = await resJson.filter(function(i, n) { + const districts = await resJson.filter((i, n) => { return i.parentCode === cantonId; }); setDistrictsList(await districts); @@ -223,7 +223,7 @@ const Communities = () => { 'Content-Type': 'application/json', }, }) - .then(function(response) { + .then((response) => { if (response.status != 201) console.log('Ocurrió un error con el servicio: ' + response.status); else return response.json(); @@ -344,12 +344,12 @@ const Communities = () => { 'Content-Type': 'application/json', }, }) - .then(function(response) { + .then((response) => { if (response.status != 201) console.log('Ocurrió un error con el servicio: ' + response.status); else return response.json(); }) - .then(function(response) { + .then((response) => { setEditCommunityDialog(false); toast.current.show({ severity: 'success', @@ -369,12 +369,12 @@ const Communities = () => { 'Content-Type': 'application/json', }, }) - .then(function(response) { + .then((response) => { if (response.status != 201) console.log('Ocurrió un error con el servicio: ' + response.status); else return response.json(); }) - .then(function(response) { + .then((response) => { let _community = communitiesList.filter( (val) => val._id !== community._id, );