1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00
onion/js/fetchers/edition_list_fetcher.js
2015-06-04 09:16:30 +02:00

19 lines
500 B
JavaScript

import fetch from '../utils/fetch';
import { generateOrderingQueryParams } from '../utils/fetch_api_utils';
import AppConstants from '../constants/application_constants';
let EditionListFetcher = {
/**
* Fetches a list of editions from the API.
*/
fetch(pieceId, orderBy, orderAsc) {
let ordering = generateOrderingQueryParams(orderBy, orderAsc);
return fetch.get('editions_list', { 'piece_id': pieceId, ordering });
}
};
export default EditionListFetcher;