-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
If I want to get my profile data I have to do two calls
hoodie.account.signIn({username: 'foo', password: 'bar'})
.then(function () {
return hoodie.account.profile.fetch()
})
.then(function () {
// hoodie.account.profile.get() now returns locally cached profile data
})Our JSON API supports the ?include parameter for all requests, so we could do two things
I would suggest to include option to signIn / signOut methods (we already do this for some of the admin API methods). The fetch method would need to send the ?include=account.profile param if it was called with something like account.fetch('profile.settings')
With that change all profile properties would be cached offline after signIn, so we can do hoodie.account.profile.get() later any time, even without an internet connection.
hoodie.account.signIn({username: 'foo', password: 'bar', include: 'profile'})
.then(function () {
// hoodie.account.profile.get() now returns locally cached profile data
})