|
@@ -53,15 +53,15 @@ let store = {
|
|
|
this._state.messagesPage.newMessageBody = action.body;
|
|
|
this._callSubscriber(this._state);
|
|
|
} else if(action.type === SEND_MESSAGE) {
|
|
|
- let body = this._state.messagesPage.newMessageBody = action.body;
|
|
|
+ let body = this._state.messagesPage.newMessageBody;
|
|
|
this._state.messagesPage.newMessageBody = 0;
|
|
|
- this._state.messagesPage.newMessageBody.push({ id: 4, message: body });
|
|
|
+ this._state.messagesPage.messagesData.push({ id: 4, message: body });
|
|
|
this._callSubscriber(this._state);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-export const addPostActionCreator = () => ({ type: 'ADD-POST' });
|
|
|
+export const addPostActionCreator = (body) => ({ type: 'ADD-POST', body });
|
|
|
export const updateNewPostTextActionCreator = (text) => {
|
|
|
return {
|
|
|
type: 'UPDATE-NEW-POST-TEXT',
|