Created
December 11, 2015 16:44
-
-
Save jherdman/65b60397a359c7101062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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