2015-08-10 17:02:10 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import requests from '../../../../utils/requests';
|
|
|
|
|
|
|
|
|
|
|
|
let PrizeRatingFetcher = {
|
2015-08-24 15:33:36 +02:00
|
|
|
fetchAverage(pieceId) {
|
|
|
|
return requests.get('rating_average', {'piece_id': pieceId});
|
2015-08-10 17:02:10 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
fetchOne(pieceId) {
|
|
|
|
return requests.get('rating', {'piece_id': pieceId});
|
|
|
|
},
|
|
|
|
|
|
|
|
rate(pieceId, rating) {
|
2015-08-24 15:33:36 +02:00
|
|
|
return requests.post('ratings', {body: {'piece_id': pieceId, 'note': rating}});
|
2015-08-25 15:19:10 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
select(pieceId) {
|
|
|
|
return requests.post('select_piece', {'piece_id': pieceId});
|
2015-08-10 17:02:10 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default PrizeRatingFetcher;
|