From af57c984e999c4782df4e8021eafa6533d87bb3f Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Thu, 4 Aug 2022 00:54:52 -0600 Subject: [PATCH] use strict equals --- web-ui/web-react/src/components/Inquilinos.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web-ui/web-react/src/components/Inquilinos.js b/web-ui/web-react/src/components/Inquilinos.js index 71da4186..4325bcf5 100644 --- a/web-ui/web-react/src/components/Inquilinos.js +++ b/web-ui/web-react/src/components/Inquilinos.js @@ -58,15 +58,15 @@ const Inquilinos = () => { .then((response) => response.json()) .then((data) => data.message) .then((data) => { - data = data.filter((val) => val.status != -1) + data = data.filter((val) => val.status !== -1) data.map((item) => { - if (item.status == '1') { + if (item.status === '1') { item.status_text = 'Activo' - } else if (item.status == '0') { + } else if (item.status === '0') { item.status_text = 'Inactivo' } - if (item.number_house == '') { + if (item.number_house === '') { item.number_house = 'Sin vivienda asignada' } }) @@ -81,7 +81,7 @@ const Inquilinos = () => { ) let resList = await response.json() let list = await resList.message - list = await list.filter((val) => val.status != -1) + list = await list.filter((val) => val.status !== -1) setCommunitiesList(await list) } @@ -158,10 +158,10 @@ const Inquilinos = () => { } const cambiarStatusUser = () => { - if (tenant.status == '1') { + if (tenant.status === '1') { tenant.status = '0' tenant.status_text = 'Inactivo' - } else if (tenant.status == '0') { + } else if (tenant.status === '0') { tenant.status = '1' tenant.status_text = 'Activo' } @@ -178,7 +178,7 @@ const Inquilinos = () => { }, }) .then((response) => { - if (response.status != 201) { + if (response.status !== 201) { console.log('OcurriĆ³ un error con el servicio: ' + response.status) } else { return response.json() @@ -225,10 +225,10 @@ const Inquilinos = () => { const actionsTenant = (rowData) => { let icono = '' let text = '' - if (rowData.status == '0') { + if (rowData.status === '0') { icono = 'pi pi-eye' text = 'Activar Inquilino' - } else if (rowData.status == '1') { + } else if (rowData.status === '1') { icono = 'pi pi-eye-slash' text = 'Inactivar Inquilino' }