diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index 267a68ba..32345133 100644 --- a/go-app-ussd_tb_check.js +++ b/go-app-ussd_tb_check.js @@ -1171,7 +1171,7 @@ go.app = function () { var payload = { data: { - commit_get_tested: answers.state_commit_to_get_tested ? "yes" : "no", + commit_get_tested: answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes" ? "yes" : "no", "source": "USSD", clinic_visit_day: answers.clinic_visit_day, }, @@ -1184,7 +1184,7 @@ go.app = function () { .patch(self.im.config.healthcheck.url + "/v2/tbcheck/"+ id +"/", payload) .then( function () { - if (answers.state_commit_to_get_tested){ + if (answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes"){ return self.states.create("state_commitment"); } else{ diff --git a/src/ussd_tb_check.js b/src/ussd_tb_check.js index 3da74cae..c3db7cb1 100644 --- a/src/ussd_tb_check.js +++ b/src/ussd_tb_check.js @@ -1054,7 +1054,7 @@ go.app = function () { var payload = { data: { - commit_get_tested: answers.state_commit_to_get_tested ? "yes" : "no", + commit_get_tested: answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes" ? "yes" : "no", "source": "USSD", clinic_visit_day: answers.clinic_visit_day, }, @@ -1067,7 +1067,7 @@ go.app = function () { .patch(self.im.config.healthcheck.url + "/v2/tbcheck/"+ id +"/", payload) .then( function () { - if (answers.state_commit_to_get_tested){ + if (answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes"){ return self.states.create("state_commitment"); } else{ diff --git a/test/ussd_tb_check.test.js b/test/ussd_tb_check.test.js index 2694c375..59ef6c3a 100644 --- a/test/ussd_tb_check.test.js +++ b/test/ussd_tb_check.test.js @@ -2122,7 +2122,7 @@ describe("ussd_tb_check app", function () { .state("state_submit_test_commit") .setup.user.answers({ tbcheck_id: 22, - state_commit_to_get_tested: true, + state_commit_to_get_tested: "state_commit_to_get_tested_yes", }) .setup(function (api) { api.http.fixtures.add({ @@ -2155,7 +2155,7 @@ describe("ussd_tb_check app", function () { .state("state_submit_test_commit") .setup.user.answers({ tbcheck_id: 22, - state_commit_to_get_tested: false, + state_commit_to_get_tested: "state_submit_test_commit", }) .setup(function (api) { api.http.fixtures.add({