Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updateJourney: function(originCode, destinationCode) {
- var validInput = this.validateJourney(originCode, destinationCode);
- // If the input is valid
- if(validInput && originCode !== destinationCode) {
- //Make WWFService Call
- WhereWeFlyServiceFactory.getCityToCity(originCode, destinationCode)
- .then(function(response) {
- self.originCity.name = response.originAndDestination.originCity.name
- self.originCity.code = response.originAndDestination.originCity.code
- console.log(response.originAndDestination.originCity);
- console.log(response.originAndDestination.destinationCity);
- })
- ['catch'](function(error) {
- NotificationsFactory.setNotification('error', error.data.errors[0].code);
- });
- } else {
- // Display invalid input error
- NotificationsFactory.setNotification('error', 'invalid-inputs');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement