1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-07-04 09:19:19 +00:00

feat: add boosters to API (#737)

This commit is contained in:
2025-05-18 00:53:26 +02:00
committed by GitHub
parent 8ca40f410d
commit c809b14783
815 changed files with 3183 additions and 960 deletions

View File

@ -1,4 +1,4 @@
import { objectKeys } from '@dzeio/object-util'
import { objectKeys, objectMap } from '@dzeio/object-util'
import { Set, SupportedLanguages } from '../../../interfaces'
import { SetResume, Set as SetSingle } from '../../../meta/definitions/api'
import { cardToCardSimple, getCards } from './cardUtil'
@ -106,6 +106,11 @@ export async function setToSetSingle(set: Set, lang: SupportedLanguages): Promis
abbreviation: (set.abbreviations?.official || resolveText(set.abbreviations, lang)) ? {
official: set.abbreviations?.official,
localized: resolveText(set.abbreviations, lang)
} : undefined
} : undefined,
boosters: set.boosters ? objectMap(set.boosters, (booster, id) => ({
id: `boo_${set.id}-${id}`,
name: resolveText(booster.name, lang),
// images will be coming soon...
})) : undefined,
}
}