2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
2015-05-20 16:19:40 +02:00
|
|
|
|
2015-06-16 13:48:48 +02:00
|
|
|
import requests from '../utils/requests';
|
2015-06-20 16:43:18 +02:00
|
|
|
import apiUrls from '../constants/api_urls';
|
2015-05-20 16:44:45 +02:00
|
|
|
|
2015-05-20 16:19:40 +02:00
|
|
|
let UserFetcher = {
|
|
|
|
/**
|
|
|
|
* Fetch one user from the API.
|
|
|
|
* If no arg is supplied, load the current user
|
|
|
|
*/
|
|
|
|
fetchOne() {
|
2015-06-16 13:48:48 +02:00
|
|
|
return requests.get('user');
|
2015-06-20 16:43:18 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
logout() {
|
|
|
|
return requests.get(apiUrls.users_logout);
|
2015-05-20 16:19:40 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UserFetcher;
|