Use empty array as initial state of piece and edition list notifications

This commit is contained in:
Brett Sun 2015-12-16 10:24:44 +01:00
parent 5e6b483149
commit 874aad05b8
3 changed files with 8 additions and 6 deletions

View File

@ -12,8 +12,8 @@ class NotificationActions {
'flushPieceListNotifications',
'updateEditionListNotifications',
'flushEditionListNotifications',
'updateEditionNotifications',
'updatePieceNotifications',
'updateEditionNotifications',
'updateContractAgreementListNotifications',
'flushContractAgreementListNotifications'
);

View File

@ -16,7 +16,7 @@ let NotificationFetcher = {
fetchEditionListNotifications() {
return requests.get('notification_editionlist');
},
fetchEditionNotifications(editionId) {
return requests.get('notification_edition', {'edition_id': editionId});
},

View File

@ -8,13 +8,15 @@ import NotificationActions from '../actions/notification_actions';
class NotificationStore {
constructor() {
this.pieceListNotifications = {};
this.editionListNotifications = {};
this.pieceListNotifications = [];
this.pieceNotifications = null;
this.editionListNotifications = [];
this.editionNotifications = null;
// Need to determine if contract agreement notifications have been loaded or not,
// so we use null here instead of an empty array
this.contractAgreementListNotifications = null;
this.editionNotifications = null;
this.pieceNotifications = null;
this.bindActions(NotificationActions);
}