1
0
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:
Florian Bouillon 2021-11-04 11:01:56 +01:00 committed by GitHub
parent c4b4449fd4
commit 65e5bdb9ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

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

View File

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