Skip to content

Commit e035312

Browse files
rename service ('registrations' -> 'hub)
1 parent a4e9098 commit e035312

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

go-app-ussdapp.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@ go.utils_project = {
521521

522522
// REGISTRATION HELPERS
523523

524+
create_registration: function(im, reg_info) {
525+
return go.utils
526+
.service_api_call("hub", "post", null, reg_info, "registration/", im)
527+
.then(function(result) {
528+
return result.id;
529+
});
530+
},
531+
524532
compile_reg_info: function(im) {
525533
var reg_info = {
526534
user_id: im.user.answers.user_id,
@@ -537,7 +545,7 @@ go.utils_project = {
537545

538546
finish_registration: function(im) {
539547
var reg_info = go.utils_project.compile_reg_info(im);
540-
return go.utils
548+
return go.utils_project
541549
.create_registration(im, reg_info)
542550
.then(function() {
543551
return go.utils

src/utils_project.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ go.utils_project = {
77

88
// REGISTRATION HELPERS
99

10+
create_registration: function(im, reg_info) {
11+
return go.utils
12+
.service_api_call("hub", "post", null, reg_info, "registration/", im)
13+
.then(function(result) {
14+
return result.id;
15+
});
16+
},
17+
1018
compile_reg_info: function(im) {
1119
var reg_info = {
1220
user_id: im.user.answers.user_id,
@@ -23,7 +31,7 @@ go.utils_project = {
2331

2432
finish_registration: function(im) {
2533
var reg_info = go.utils_project.compile_reg_info(im);
26-
return go.utils
34+
return go.utils_project
2735
.create_registration(im, reg_info)
2836
.then(function() {
2937
return go.utils

test/ussdapp.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("UoP TB registration/quiz app", function() {
2626
api_token: 'test_token_identities',
2727
url: "http://localhost:8001/api/v1/"
2828
},
29-
"registrations": {
29+
"hub": {
3030
api_token: 'test_token_registrations',
3131
url: "http://localhost:8002/api/v1/"
3232
},

0 commit comments

Comments
 (0)