mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-23 03:12:10 +00:00
fix: Same problem for set subid (#158)
* fix: Fix /sets/:id endpoint to check in lowercase Signed-off-by: Avior <github@avior.me> * fix: Same problem for set subid Signed-off-by: Avior <github@avior.me>
This commit is contained in:
parent
d432b8a826
commit
e12adb1641
@ -81,8 +81,8 @@ export default class Card implements LocalCard {
|
||||
public static findOne(lang: SupportedLanguages, params: Partial<Record<keyof SDKCard, any>> = {}) {
|
||||
const res = (require(`../../../generated/${lang}/cards.json`) as Array<SDKCard>).find((c) => {
|
||||
return objectLoop(params, (it, key) => {
|
||||
if (key === 'set') {
|
||||
return c['set'].id.includes(it) || c['set'].name.includes(it)
|
||||
if (key === 'set' && typeof it === 'string') {
|
||||
return c['set'].id.toLowerCase().includes(it.toLowerCase()) || c['set'].name.toLowerCase().includes(it.toLowerCase())
|
||||
}
|
||||
if (typeof it === "string") {
|
||||
return c[key as 'localId'].toLowerCase().includes(it.toLowerCase())
|
||||
|
Loading…
x
Reference in New Issue
Block a user