1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00
onion/js/actions/user_actions.js

24 lines
513 B
JavaScript
Raw Normal View History

2015-05-20 16:19:40 +02:00
import alt from '../alt';
import UserFetcher from '../fetchers/user_fetcher';
2015-05-20 16:44:45 +02:00
2015-05-20 16:19:40 +02:00
class UserActions {
constructor() {
this.generateActions(
'updateCurrentUser'
);
}
fetchCurrentUser() {
UserFetcher.fetchOne()
.then((res) => {
this.actions.updateCurrentUser(res['users'][0]);
})
.catch((err) => {
console.log(err);
});
}
};
export default alt.createActions(UserActions);