mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
6cc9ce8094
Avoids new user getting asked if they want to cancel registration of a piece before they even agree to the Ikono contract.
72 lines
2.2 KiB
JavaScript
72 lines
2.2 KiB
JavaScript
'use strict';
|
|
|
|
import { alt } from '../alt';
|
|
import Q from 'q';
|
|
|
|
import NotificationFetcher from '../fetchers/notification_fetcher';
|
|
|
|
class NotificationActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updatePieceListNotifications',
|
|
'flushPieceListNotifications',
|
|
'updateEditionListNotifications',
|
|
'flushEditionListNotifications',
|
|
'updateEditionNotifications',
|
|
'updatePieceNotifications',
|
|
'updateContractAgreementListNotifications',
|
|
'flushContractAgreementListNotifications'
|
|
);
|
|
}
|
|
|
|
fetchPieceListNotifications() {
|
|
NotificationFetcher
|
|
.fetchPieceListNotifications()
|
|
.then((res) => {
|
|
this.actions.updatePieceListNotifications(res);
|
|
})
|
|
.catch((err) => console.logGlobal(err));
|
|
}
|
|
|
|
fetchPieceNotifications(pieceId) {
|
|
NotificationFetcher
|
|
.fetchPieceNotifications(pieceId)
|
|
.then((res) => {
|
|
this.actions.updatePieceNotifications(res);
|
|
})
|
|
.catch((err) => console.logGlobal(err));
|
|
}
|
|
|
|
fetchEditionListNotifications() {
|
|
NotificationFetcher
|
|
.fetchEditionListNotifications()
|
|
.then((res) => {
|
|
this.actions.updateEditionListNotifications(res);
|
|
})
|
|
.catch((err) => console.logGlobal(err));
|
|
}
|
|
|
|
fetchEditionNotifications(editionId) {
|
|
NotificationFetcher
|
|
.fetchEditionNotifications(editionId)
|
|
.then((res) => {
|
|
this.actions.updateEditionNotifications(res);
|
|
})
|
|
.catch((err) => console.logGlobal(err));
|
|
}
|
|
|
|
fetchContractAgreementListNotifications() {
|
|
return Q.Promise((resolve, reject) => {
|
|
NotificationFetcher
|
|
.fetchContractAgreementListNotifications()
|
|
.then((res) => {
|
|
this.actions.updateContractAgreementListNotifications(res);
|
|
resolve(res);
|
|
})
|
|
.catch((err) => console.logGlobal(err));
|
|
});
|
|
}
|
|
}
|
|
|
|
export default alt.createActions(NotificationActions);
|