mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 13:41:57 +02:00
35 lines
909 B
JavaScript
35 lines
909 B
JavaScript
|
'use strict';
|
||
|
|
||
|
import alt from '../alt';
|
||
|
|
||
|
import NotificationFetcher from '../fetchers/notification_fetcher';
|
||
|
|
||
|
class NotificationActions {
|
||
|
constructor() {
|
||
|
this.generateActions(
|
||
|
'updatePieceListNotifications',
|
||
|
'updateEditionListNotifications'
|
||
|
);
|
||
|
}
|
||
|
|
||
|
fetchPieceListNotifications() {
|
||
|
NotificationFetcher
|
||
|
.fetchPieceListNotifications()
|
||
|
.then((res) => {
|
||
|
this.actions.updatePieceListNotifications(res);
|
||
|
})
|
||
|
.catch((err) => console.logGlobal(err));
|
||
|
}
|
||
|
|
||
|
fetchEditionListNotifications() {
|
||
|
NotificationFetcher
|
||
|
.fetchEditionListNotifications()
|
||
|
.then((res) => {
|
||
|
this.actions.updateEditionListNotifications(res);
|
||
|
})
|
||
|
.catch((err) => console.logGlobal(err));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default alt.createActions(NotificationActions);
|