🐛 Résolution d'un bug dans la construction des données d'inversion
parent
9ace5b3bca
commit
21f39f3fe1
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue