Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. updateJourney: function(originCode, destinationCode) {
  2.             var validInput = this.validateJourney(originCode, destinationCode);
  3.  
  4.             // If the input is valid
  5.             if(validInput && originCode !== destinationCode) {
  6.  
  7.                 //Make WWFService Call
  8.                 WhereWeFlyServiceFactory.getCityToCity(originCode, destinationCode)
  9.                     .then(function(response) {
  10.                         self.originCity.name = response.originAndDestination.originCity.name
  11.                         self.originCity.code = response.originAndDestination.originCity.code
  12.                         console.log(response.originAndDestination.originCity);
  13.                         console.log(response.originAndDestination.destinationCity);
  14.                     })
  15.                     ['catch'](function(error) {
  16.                         NotificationsFactory.setNotification('error', error.data.errors[0].code);
  17.                     });
  18.  
  19.             } else {
  20.                 // Display invalid input error
  21.                 NotificationsFactory.setNotification('error', 'invalid-inputs');
  22.             }
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement