2015-08-05 14:40:26 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-11-05 16:45:12 +01:00
|
|
|
import { alt } from '../../../../../alt';
|
2015-08-05 14:40:26 +02:00
|
|
|
|
|
|
|
import PrizeFetcher from '../fetchers/prize_fetcher';
|
|
|
|
|
|
|
|
class PrizeActions {
|
|
|
|
constructor() {
|
|
|
|
this.generateActions(
|
|
|
|
'updatePrize'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchPrize() {
|
2015-11-06 15:47:55 +01:00
|
|
|
PrizeFetcher
|
|
|
|
.fetch()
|
|
|
|
.then((res) => {
|
|
|
|
this.actions.updatePrize({
|
|
|
|
prize: res.prize
|
2015-08-05 14:40:26 +02:00
|
|
|
});
|
2015-11-06 15:47:55 +01:00
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.logGlobal(err);
|
|
|
|
});
|
2015-08-05 14:40:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default alt.createActions(PrizeActions);
|