2015-06-01 17:43:38 +02:00
|
|
|
import fetch from '../utils/fetch';
|
2015-05-21 17:59:38 +02:00
|
|
|
|
2015-06-04 09:16:30 +02:00
|
|
|
import { generateOrderingQueryParams } from '../utils/fetch_api_utils';
|
|
|
|
|
2015-05-21 17:59:38 +02:00
|
|
|
import AppConstants from '../constants/application_constants';
|
|
|
|
|
|
|
|
|
|
|
|
let EditionListFetcher = {
|
|
|
|
/**
|
|
|
|
* Fetches a list of editions from the API.
|
|
|
|
*/
|
2015-06-04 09:16:30 +02:00
|
|
|
fetch(pieceId, orderBy, orderAsc) {
|
|
|
|
let ordering = generateOrderingQueryParams(orderBy, orderAsc);
|
|
|
|
return fetch.get('editions_list', { 'piece_id': pieceId, ordering });
|
2015-05-21 17:59:38 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-06-01 17:43:38 +02:00
|
|
|
export default EditionListFetcher;
|