From f47bf4a6cd7c1051673623fa20d2e8fdefcc81cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismo=20Metsa=CC=88virta?= Date: Sun, 21 Jan 2024 13:02:44 +0200 Subject: [PATCH 1/3] fix(levels): return empty array instead of null in get(Not)InIndexes --- src/api/level.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/level.js b/src/api/level.js index 8ea63bf0..927c05de 100644 --- a/src/api/level.js +++ b/src/api/level.js @@ -258,7 +258,7 @@ const getLevels = async ( // Find the intersection of arrays to use const intersectionResult = - arraysToIntersect.length > 0 ? intersection(...arraysToIntersect) : null; + arraysToIntersect.length > 0 ? intersection(...arraysToIntersect) : []; return intersectionResult; }; @@ -271,7 +271,7 @@ const getLevels = async ( const arraysToConcat = arraysToUse.filter(array => array.length > 0); - return arraysToConcat.length > 0 ? [].concat(...arraysToConcat) : null; + return arraysToConcat.length > 0 ? [].concat(...arraysToConcat) : []; }; const shouldIncludeInIndexes = From aa50247f5bdedac0c88f47b569917b343f9a1bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismo=20Metsa=CC=88virta?= Date: Sun, 21 Jan 2024 13:12:50 +0200 Subject: [PATCH 2/3] fix(levels): return AddedBy to level response --- src/api/level.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/level.js b/src/api/level.js index 927c05de..6c7dc85d 100644 --- a/src/api/level.js +++ b/src/api/level.js @@ -30,6 +30,7 @@ const attributes = [ 'Hidden', 'Legacy', 'AcceptBugs', + 'AddedBy', ]; const getLevel = async (LevelIndex, withStats = false) => { From b184ff7edbf1d5a75680fdaf793687cf2067f5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismo=20Metsa=CC=88virta?= Date: Sun, 21 Jan 2024 13:30:33 +0200 Subject: [PATCH 3/3] fix(tags): order tag options alphabetically --- src/api/tag.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/tag.js b/src/api/tag.js index 2a7e5651..310964b5 100644 --- a/src/api/tag.js +++ b/src/api/tag.js @@ -7,7 +7,9 @@ const router = express.Router(); const getTags = async Type => { const data = await Tag.findAll(); - return data.filter(tag => (Type ? Type === tag.Type : true)); + return data + .filter(tag => (Type ? Type === tag.Type : true)) + .sort((a, b) => a.Name.toLowerCase().localeCompare(b.Name.toLowerCase())); }; const createTag = async data => {