Skip to content

Commit

Permalink
renaming form result to pathway result
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Jan 19, 2017
1 parent 3628692 commit 4a4552e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pathway/static/js/pathway/services/pathway.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ angular.module('opal.services').service('Pathway', function(

Pathway.prototype = {
open: function(){
this.formResult = $q.defer();
this.pathwayResult = $q.defer();
this.initialise();
return this.formResult.promise;
return this.pathwayResult.promise;
},
initialise: function(){
var self = this;
Expand Down Expand Up @@ -55,7 +55,7 @@ angular.module('opal.services').service('Pathway', function(
},

cancel: function(){
this.formResult.resolve();
this.pathwayResult.resolve();
},
preSave: function(editing){},
valid: function(editing){ return true },
Expand Down Expand Up @@ -93,7 +93,7 @@ angular.module('opal.services').service('Pathway', function(
var endpoint = this.save_url;
var result = $http.post(endpoint, toSave).then(
function(response){
self.formResult.resolve(response.data);
self.pathwayResult.resolve(response.data);
}, function(error){
$window.alert("unable to save patient");
});
Expand Down
2 changes: 1 addition & 1 deletion pathway/static/js/pathwaytest/pathway_service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Pathway', function() {
});

describe("open", function(){
it("should return the form result promise", function(){
it("should return the pathway result as a promise", function(){
var response = pathway.open();
expect(!!response.then).toBe(true);
});
Expand Down

0 comments on commit 4a4552e

Please sign in to comment.