1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 17:45:10 +01:00
onion/js/components/whitelabel/prize/fetchers/prize_rating_fetcher.js

21 lines
412 B
JavaScript
Raw Normal View History

2015-08-10 17:02:10 +02:00
'use strict';
import requests from '../../../../utils/requests';
let PrizeRatingFetcher = {
fetch() {
return requests.get('rating');
},
fetchOne(pieceId) {
return requests.get('rating', {'piece_id': pieceId});
},
rate(pieceId, rating) {
2015-08-12 13:21:05 +02:00
return requests.post('ratings', {body: {'piece_id': pieceId, 'value': rating}});
2015-08-10 17:02:10 +02:00
}
};
export default PrizeRatingFetcher;