🐛 Résolution d'un bug dans la construction des données d'inversion

pull/138/head
mama 2017-11-24 18:45:28 +01:00
parent 9ace5b3bca
commit 21f39f3fe1
1 changed files with 9 additions and 9 deletions

View File

@ -75,8 +75,10 @@ let buildVariantTree = (allRules, path) => {
}
let buildPossibleInversion = (rule, flatRules, targetNames) => {
let inversions = R.path(['formule', 'inversion', 'avec'])(rule),
inversionObjects = inversions.map(i =>
let ruleInversions = R.path(['formule', 'inversion', 'avec'])(rule)
if (!ruleInversions) return null
let
inversionObjects = ruleInversions.map(i =>
findRuleByDottedName(
flatRules,
disambiguateRuleReference(flatRules, rule, i)
@ -84,13 +86,11 @@ let buildPossibleInversion = (rule, flatRules, targetNames) => {
),
yo = R.reject(({ name }) => targetNames.includes(name))([rule].concat(inversionObjects))
return (
inversions && {
inversions: yo,
question: rule.formule.inversion.question,
title: rule.formule.inversion.titre
}
)
return {
inversions: yo,
question: rule.formule.inversion.question,
title: rule.formule.inversion.titre
}
}
export let makeQuestion = (flatRules, targetNames) => dottedName => {