From 7f67761e15ee515bce2474c1bed5d16dfcf842e3 Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Thu, 26 Oct 2023 11:01:23 +0200 Subject: [PATCH] first check if research consent no answer is state gender --- go-app-ussd_tb_check.js | 7 ++++++- src/ussd_tb_check.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index d716bc7f..3d560fa0 100644 --- a/go-app-ussd_tb_check.js +++ b/go-app-ussd_tb_check.js @@ -1005,7 +1005,12 @@ go.app = function () { }; if (typeof self.im.user.answers.state_research_consent != "undefined"){ - if (answers.state_research_consent === "state_gender"){ + if (answers.state_research_consent_no === "state_gender"){ + payload.data.research_consent = false; + payload.data.follow_up_optin = false; + + } + else if (answers.state_research_consent === "state_gender"){ payload.data.research_consent = true; payload.data.follow_up_optin = true; } diff --git a/src/ussd_tb_check.js b/src/ussd_tb_check.js index afc7d712..55036829 100644 --- a/src/ussd_tb_check.js +++ b/src/ussd_tb_check.js @@ -888,7 +888,12 @@ go.app = function () { }; if (typeof self.im.user.answers.state_research_consent != "undefined"){ - if (answers.state_research_consent === "state_gender"){ + if (answers.state_research_consent_no === "state_gender"){ + payload.data.research_consent = false; + payload.data.follow_up_optin = false; + + } + else if (answers.state_research_consent === "state_gender"){ payload.data.research_consent = true; payload.data.follow_up_optin = true; }