You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
612 B
25 lines
612 B
import Ember from 'ember'; |
|
import config from '../config/environment'; |
|
|
|
export default Ember.Route.extend({ |
|
model: function(params) { |
|
var url = config.APP.ApiUrl + 'api/accounts/' + params.login; |
|
return Ember.$.getJSON(url).then(function(data) { |
|
data.login = params.login; |
|
return Ember.Object.create(data); |
|
}); |
|
}, |
|
|
|
setupController: function(controller, model) { |
|
this._super(controller, model); |
|
Ember.run.later(this, this.refresh, 5000); |
|
}, |
|
|
|
actions: { |
|
error(error) { |
|
if (error.status === 404) { |
|
return this.transitionTo('not-found'); |
|
} |
|
} |
|
} |
|
});
|
|
|