mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 21:52:08 +02:00
23 lines
512 B
JavaScript
23 lines
512 B
JavaScript
|
import alt from '../alt';
|
||
|
import UserFetcher from '../fetchers/user_fetcher';
|
||
|
|
||
|
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);
|