mirror of
https://github.com/tcgdex/compiler.git
synced 2025-07-31 00:10:45 +00:00
Update in progress
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
@ -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> = []
|
||||
|
@ -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}`
|
||||
|
Reference in New Issue
Block a user