1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-22 10:52:10 +00:00

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

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
Florian Bouillon 2021-11-12 14:37:49 +01:00 committed by GitHub
parent a8c1188e5f
commit 5ef66aac3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
})
})