🐛 Gestion de l'objet de retour de l'API

pull/337/head
Mael 2018-09-07 13:06:55 +02:00
parent afee378570
commit 46f575138d
2 changed files with 3 additions and 2 deletions

View File

@ -982,8 +982,7 @@ export let mecanismSynchronisation = (recurse, k, v) => {
let nodeValue =
val(APIExplanation) == null
? null
: console.log(APIExplanation) ||
path(v.chemin.split(' . '))(JSON.parse(val(APIExplanation)))
: path(v.chemin.split(' . '))(val(APIExplanation))
let missingVariables =
val(APIExplanation) === null ? { [APIExplanation.dottedName]: 1 } : {}
let explanation = { ...v, API: APIExplanation }

View File

@ -29,6 +29,8 @@ export let evaluateVariable = (situationGate, variableName, rule) => {
// test rec
let value = situationGate(variableName)
if (rule.API) return value && JSON.parse(value)
if (rule.format != null) return value
//boolean variables don't have a format prop, it's the default
if (formatBooleanValue[value] !== undefined) return formatBooleanValue[value]