mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-25 12:22:14 +00:00
fix: Fixed paths not being changed (#133)
This commit is contained in:
parent
c4b4449fd4
commit
65e5bdb9ee
@ -75,11 +75,11 @@ export default class Card implements LocalCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static raw(lang: SupportedLanguages): Array<SDKCard> {
|
public static raw(lang: SupportedLanguages): Array<SDKCard> {
|
||||||
return require(`../../generated/${lang}/cards.json`)
|
return require(`../../../generated/${lang}/cards.json`)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static findOne(lang: SupportedLanguages, params: Partial<Record<keyof SDKCard, any>> = {}) {
|
public static findOne(lang: SupportedLanguages, params: Partial<Record<keyof SDKCard, any>> = {}) {
|
||||||
const res = (require(`../../generated/${lang}/cards.json`) as Array<SDKCard>).find((c) => {
|
const res = (require(`../../../generated/${lang}/cards.json`) as Array<SDKCard>).find((c) => {
|
||||||
return objectLoop(params, (it, key) => {
|
return objectLoop(params, (it, key) => {
|
||||||
if (key === 'set') {
|
if (key === 'set') {
|
||||||
return c['set'].id.includes(it) || c['set'].name.includes(it)
|
return c['set'].id.includes(it) || c['set'].name.includes(it)
|
||||||
|
@ -28,7 +28,7 @@ export default class Serie implements LocalSerie {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static find(lang: SupportedLanguages, params: Partial<Record<keyof SDKSerie, any>> = {}, pagination?: Pagination) {
|
public static find(lang: SupportedLanguages, params: Partial<Record<keyof SDKSerie, any>> = {}, pagination?: Pagination) {
|
||||||
let list = (require(`../../generated/${lang}/series.json`) as Array<SDKSerie>)
|
let list = (require(`../../../generated/${lang}/series.json`) as Array<SDKSerie>)
|
||||||
.filter((c) => objectLoop(params, (it, key) => {
|
.filter((c) => objectLoop(params, (it, key) => {
|
||||||
return c[key as 'id'].includes(it)
|
return c[key as 'id'].includes(it)
|
||||||
}))
|
}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user