renamed text_en_rebonds, text_de_depart et text_produits to siblings, parents and children

This commit is contained in:
axolotle
2021-03-10 17:32:48 +01:00
parent 9ffc2bf167
commit 19f37aa23b
9 changed files with 45 additions and 45 deletions
+5 -5
View File
@@ -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
}
}
})