19 lines
459 B
TypeScript
19 lines
459 B
TypeScript
import * as Raid from './RaidTransformer'
|
|
|
|
// Transforms API response to RaidGroup object
|
|
export function toObject(data: any): RaidGroup {
|
|
return {
|
|
id: data.id,
|
|
name: {
|
|
en: data.name_en,
|
|
ja: data.name_jp,
|
|
},
|
|
raids: data.raids.map((raid: any) => Raid.toObject(raid)),
|
|
difficulty: data.difficulty,
|
|
section: data.section,
|
|
order: data.order,
|
|
extra: data.extra,
|
|
guidebooks: data.guidebooks,
|
|
hl: data.hl,
|
|
}
|
|
}
|