mirror of
https://github.com/tcgdex/compiler.git
synced 2025-07-29 23:49:50 +00:00
Update in progress
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
@ -4,6 +4,10 @@ import { Langs } from "@tcgdex/sdk/interfaces/LangList"
|
||||
import { promises as fs } from 'fs'
|
||||
import Rarity, { RaritySimple, RarityList } from "@tcgdex/sdk/interfaces/Rarity"
|
||||
|
||||
import { logger as console } from '@dzeio/logger'
|
||||
console.prefix = 'Rarities/Index'
|
||||
|
||||
|
||||
const lang = process.env.CARDLANG as Langs || "en"
|
||||
const endpoint = getBaseFolder(lang, "rarities")
|
||||
|
||||
|
@ -6,6 +6,10 @@ import TranslationUtil from "@tcgdex/sdk/TranslationUtil"
|
||||
import { promises } from "fs"
|
||||
import Rarity, { RaritySingle } from "@tcgdex/sdk/interfaces/Rarity"
|
||||
|
||||
import { logger as console } from '@dzeio/logger'
|
||||
console.prefix = 'Rarities/Item'
|
||||
|
||||
|
||||
type rarityCards = {
|
||||
[key in Rarity]?: Array<Card>
|
||||
}
|
||||
@ -37,7 +41,7 @@ export default async () => {
|
||||
const toSave: RaritySingle = {
|
||||
id: rCat,
|
||||
name: TranslationUtil.translate("rarity", rCat, 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