From 3715e0c4d28e5fbcadf9c247502e1e8d2ddc24fc Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 13 May 2019 20:30:25 +0200 Subject: [PATCH] Filter incomplete mucus values in sympto adapter --- lib/sympto-adapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index f2fb1c0..5caf8ea 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -113,6 +113,10 @@ function formatCycleForSympto(cycle) { if (hasIncompleteCervixValue(day)) { delete day.cervix } + // remove days with incomplete mucus value (because nfp-mucus returns null when that's the case) + if (day.mucus.value === null) { + delete day.mucus + } // change format ['bleeding', 'temperature', 'mucus'].forEach(symptomName => { if (day[symptomName]) day[symptomName] = day[symptomName].value