Skip to content

Commit

Permalink
Merge pull request #634 from praekeltfoundation/sigma-1155-CAPI-regis…
Browse files Browse the repository at this point in the history
…tration-USSD

Sigma 1155 capi registration ussd
  • Loading branch information
Buhle79 authored Jul 18, 2024
2 parents 9c9f331 + 5240c2c commit 537e4b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions go-app-ussd_clinic_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ go.app = function() {
.send_whatsapp_template_message(msisdn, template_name, media)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status_id", data.status_id);
if (data.preferred_channel == "SMS") {
return self.rapidpro.get_global_flag("sms_registrations_enabled")
.then(function(sms_registration_enabled) {
Expand Down Expand Up @@ -1425,8 +1426,6 @@ go.app = function() {
.get_whatsapp_template_status(status_id)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status", data.status);

return self.states.create("state_trigger_rapidpro_flow");
}).catch(function(e) {
// Go to error state after 3 failed HTTP requests
Expand Down
3 changes: 1 addition & 2 deletions src/ussd_clinic_rapidpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ go.app = function() {
.send_whatsapp_template_message(msisdn, template_name, media)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status_id", data.status_id);
if (data.preferred_channel == "SMS") {
return self.rapidpro.get_global_flag("sms_registrations_enabled")
.then(function(sms_registration_enabled) {
Expand Down Expand Up @@ -1164,8 +1165,6 @@ go.app = function() {
.get_whatsapp_template_status(status_id)
.then(function(data) {
self.im.user.set_answer("preferred_channel", data.preferred_channel);
self.im.user.set_answer("status", data.status);

return self.states.create("state_trigger_rapidpro_flow");
}).catch(function(e) {
// Go to error state after 3 failed HTTP requests
Expand Down

0 comments on commit 537e4b8

Please sign in to comment.