-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nos aseguramos de que safeScore sea numérico #275
base: main
Are you sure you want to change the base?
Conversation
Corregimos la ordenacion en el ranking y posiblemente otros errores que ocurran al comparar como cadenas pensando que son numeros Fix PucelaBits#189
@@ -97,15 +97,15 @@ const filenameToData = (f) => ({ | |||
.map(({ name, id }) => ({ | |||
name, | |||
id, | |||
safeScore: getSafeScore(filterByTerritorioId(all, id)), | |||
safeScore: Number(getSafeScore(filterByTerritorioId(all, id))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muchísimas gracias, @albfernandez. Tiene buena pinta la PR, hago alguna prueba más cuando saque un rato y la mergeo si está todo ok.
A priori creo que si getSafeScore ya devuelve un Number, no hace falta volverlo a convertir aquí y en la L108.
safeScore: Number(getSafeScore(filterByTerritorioId(all, id))), | |
safeScore: getSafeScore(filterByTerritorioId(all, id)), |
subTerritories: territoriesLevel2 | ||
.map(filenameToData) | ||
.filter(({ file }) => id === file.comunidad) | ||
.map(({ file, id }) => ({ id, ...file })) | ||
.map(({ name, id }) => ({ | ||
name, | ||
id, | ||
safeScore: getSafeScore(filterByTerritorioId(all, id)), | ||
safeScore: Number(getSafeScore(filterByTerritorioId(all, id))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aquí igual, creo que basta con el cambio a Number
que has hecho en el valor de retorno de la propia función
safeScore: Number(getSafeScore(filterByTerritorioId(all, id))), | |
safeScore: getSafeScore(filterByTerritorioId(all, id)), |
Corregimos la ordenacion en el ranking y posiblemente otros errores que ocurran al comparar como cadenas pensando que son numeros
Fix #189