renamed text_en_rebonds, text_de_depart et text_produits to siblings, parents and children
This commit is contained in:
Vendored
+5
-5
@@ -8,7 +8,7 @@ function flatten (arr, accumulator = []) {
|
||||
}
|
||||
|
||||
function getLinked (text) {
|
||||
const types = ['text_en_rebond', 'text_produits', 'text_de_depart']
|
||||
const types = ['siblings', 'children', 'parents']
|
||||
return types.reduce((acc, type) => {
|
||||
// Handle `null` and `undefined`
|
||||
return text[type] ? [...acc, ...text[type]] : acc
|
||||
@@ -29,8 +29,8 @@ export function toSingleManyData (rawData) {
|
||||
const links = h.links()
|
||||
nodes.forEach(node => {
|
||||
Object.assign(node.data, {
|
||||
type: node.data.__typename.toLowerCase(),
|
||||
class: 'family-' + node.data.familles[0].id
|
||||
type: node.data.type.toLowerCase(),
|
||||
class: 'family-' + node.data.families[0].id
|
||||
})
|
||||
})
|
||||
return { nodes, links }
|
||||
@@ -73,8 +73,8 @@ export function toManyManyData (rawData) {
|
||||
id: data.id,
|
||||
data: {
|
||||
...data,
|
||||
type: data.__typename.toLowerCase(),
|
||||
class: 'family-' + data.familles[0].id
|
||||
type: data.type.toLowerCase(),
|
||||
class: 'family-' + data.families[0].id
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user