Update in progress

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
2021-02-03 01:14:26 +01:00
parent 557dad7e33
commit 1e4a9ba9d1
27 changed files with 272 additions and 92 deletions

View File

@ -8,6 +8,9 @@ import { List } from "@tcgdex/sdk/interfaces/General"
const lang = process.env.CARDLANG as Langs || "en"
const endpoint = getBaseFolder(lang, "types")
import { logger as console } from '@dzeio/logger'
console.prefix = 'Types/Index'
export default async () => {
console.log(endpoint)
const typeArr: Array<TypeSimple> = []

View File

@ -6,6 +6,9 @@ import { Langs } from "@tcgdex/sdk/interfaces/LangList"
import TranslationUtil from "@tcgdex/sdk/TranslationUtil"
import { promises } from "fs"
import { logger as console } from '@dzeio/logger'
console.prefix = 'Types/Item'
type typeCards = {
[key in Type]?: Array<Card>
}
@ -36,7 +39,7 @@ export default async () => {
const toSave: TypeSingle = {
id: rType,
name: TranslationUtil.translate("type", rType, lang),
cards: cards.map(el => cardToCardSimple(el, lang))
cards: await Promise.all(cards.map(el => cardToCardSimple(el, lang)))
}
const index = `${endpoint}/${toSave.id}`