2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-06-16 13:48:48 +02:00
|
|
|
import requests from '../utils/requests';
|
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
|
|
|
|
|
|
|
let EditionListFetcher = {
|
|
|
|
/**
|
|
|
|
* Fetches a list of editions from the API.
|
|
|
|
*/
|
2015-07-03 16:31:09 +02:00
|
|
|
fetch(pieceId, page, pageSize, orderBy, orderAsc) {
|
2015-06-04 09:16:30 +02:00
|
|
|
let ordering = generateOrderingQueryParams(orderBy, orderAsc);
|
2015-07-03 16:31:09 +02:00
|
|
|
return requests.get('editions_list', {
|
|
|
|
'piece_id': pieceId,
|
|
|
|
page,
|
|
|
|
pageSize,
|
|
|
|
ordering
|
|
|
|
});
|
2015-05-21 17:59:38 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-06-01 17:43:38 +02:00
|
|
|
export default EditionListFetcher;
|