Skip to content

Instantly share code, notes, and snippets.

@villander
Created December 11, 2015 17:01
Show Gist options
  • Select an option

  • Save villander/ca59c573920c6bd993c5 to your computer and use it in GitHub Desktop.

Select an option

Save villander/ca59c573920c6bd993c5 to your computer and use it in GitHub Desktop.
actions : {
login: function(id) {
Ember.run(() => {
this.store.find('profile', { orderBy: 'profileId', equalTo: id }).then(profile => {
profile = profile.get('firstObject');
this.get('session').set('currentProfile', profile);
return this.store.find('conversation', { orderBy: 'me', equalTo: profile.get('id') }).then(conversations => {
let other = conversations.get('firstObject.other');
this.transitionTo('conversation', other.get('profileId'));
});
});
});
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment