mirror of https://github.com/ascribe/onion.git
21 lines
647 B
JavaScript
21 lines
647 B
JavaScript
import fetch from 'isomorphic-fetch';
|
|
|
|
import AppConstants from '../constants/application_constants';
|
|
import FetchApiUtils from '../utils/fetch_api_utils';
|
|
|
|
var ArtworkListFetcher = {
|
|
fetch(page=1, pageSize=10) {
|
|
let params = FetchApiUtils.argsToQueryParams({
|
|
page,
|
|
'page_size': pageSize // this is kind of a bummer...
|
|
});
|
|
|
|
return fetch(AppConstants.baseUrl + 'pieces/' + params, {
|
|
headers: {
|
|
'Authorization': 'Basic ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw'
|
|
}
|
|
}).then((res) => { return res.json(); });
|
|
}
|
|
};
|
|
|
|
export default ArtworkListFetcher; |