1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-06-12 15:59:18 +00:00

fix: Make /series/:serie case insensitive (#164)

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
2021-11-12 14:37:49 +01:00
committed by GitHub
parent a8c1188e5f
commit 5ef66aac3b

View File

@ -43,6 +43,9 @@ export default class Serie implements LocalSerie {
const res = (require(`../../../generated/${lang}/series.json`) as Array<SDKSerie>)
.find((c) => {
return objectLoop(params, (it, key) => {
if (typeof it === 'string') {
return c[key as 'id'].toLowerCase().includes(it.toLowerCase())
}
return c[key as 'id'].includes(it)
})
})