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:
@ -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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user