Skip to content

Instantly share code, notes, and snippets.

@jherdman
Created December 11, 2015 16:44
Show Gist options
  • Save jherdman/65b60397a359c7101062 to your computer and use it in GitHub Desktop.
Save jherdman/65b60397a359c7101062 to your computer and use it in GitHub Desktop.
actions : {
login: function(id) {
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