import Ember from 'ember';

export default Ember.Controller.extend({
  createFeedFromGtfsService: Ember.inject.service('create-feed-from-gtfs'),
  actions: {
    next: function() {
      if (this.get('createFeedFromGtfsService').downloadGtfsArchiveAndParseIntoFeedModel()) {
        this.transitionToRoute('feeds.new.add-operator');
      } else {
        alert('TODO: replace me with a nicer error message');
      }
    }
  }
});

import Ember from 'ember';

export default Ember.Controller.extend({
  createFeedFromGtfsService: Ember.inject.service('create-feed-from-gtfs'),
  actions: {
    next: function() {
      var controller = this;
      this
        .get('createFeedFromGtfsService')
        .downloadGtfsArchiveAndParseIntoFeedModel()
        .then(function(){
          controller.transitionToRoute('feeds.new.add-operator');
        })
        .catch(function(){
          alert('Error');
          // controller.transitionToRoute('error');
        });
    }
  }
});

Call feed fetch_info, then transition to add-operator