2015-05-26 13:48:00 +02:00
|
|
|
import fetch from 'isomorphic-fetch';
|
|
|
|
|
|
|
|
import AppConstants from '../constants/application_constants';
|
|
|
|
import FetchApiUtils from '../utils/fetch_api_utils';
|
|
|
|
|
|
|
|
|
2015-05-26 13:48:46 +02:00
|
|
|
let EditionFetcher = {
|
2015-05-26 13:48:00 +02:00
|
|
|
/**
|
|
|
|
* Fetch one user from the API.
|
|
|
|
* If no arg is supplied, load the current user
|
|
|
|
*
|
|
|
|
*/
|
2015-05-26 14:58:11 +02:00
|
|
|
fetchOne(editionId) {
|
|
|
|
return fetch(AppConstants.baseUrl + 'editions/' + editionId + '/', {
|
2015-05-26 13:48:00 +02:00
|
|
|
headers: {
|
|
|
|
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
|
|
|
|
}
|
2015-05-26 14:58:11 +02:00
|
|
|
}).then(
|
|
|
|
(res) => res.json()
|
|
|
|
);
|
2015-05-26 13:48:00 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-05-26 13:48:46 +02:00
|
|
|
export default EditionFetcher;
|