1
0
mirror of https://github.com/ascribe/onion.git synced 2024-09-28 12:08:55 +02:00
onion/js/fetchers/edition_fetcher.js

23 lines
587 B
JavaScript
Raw Normal View History

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 = {
/**
* Fetch one user from the API.
* If no arg is supplied, load the current user
*
*/
fetchOne(pieceId) {
return fetch(AppConstants.baseUrl + 'editions/' + pieceId + '/', {
headers: {
'Authorization': 'Basic ' + AppConstants.debugCredentialBase64
}
}).then((res) => res.json());
}
};
2015-05-26 13:48:46 +02:00
export default EditionFetcher;