mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
24 lines
548 B
JavaScript
24 lines
548 B
JavaScript
'use strict';
|
|
|
|
import requests from '../utils/requests';
|
|
|
|
import { generateOrderingQueryParams } from '../utils/fetch_api_utils';
|
|
|
|
|
|
let EditionListFetcher = {
|
|
/**
|
|
* Fetches a list of editions from the API.
|
|
*/
|
|
fetch(pieceId, page, pageSize, orderBy, orderAsc) {
|
|
let ordering = generateOrderingQueryParams(orderBy, orderAsc);
|
|
return requests.get('editions_list', {
|
|
'piece_id': pieceId,
|
|
page,
|
|
pageSize,
|
|
ordering
|
|
});
|
|
}
|
|
};
|
|
|
|
export default EditionListFetcher;
|