Skip to content
Snippets Groups Projects
Commit c611e7a5 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

#68 actions postNews params updated

parent d013c9a4
No related branches found
No related tags found
No related merge requests found
...@@ -16,11 +16,11 @@ export const getNews = () => ( ...@@ -16,11 +16,11 @@ export const getNews = () => (
} }
); );
export const postNews = ({ title, author, text }) => ( export const postNews = ({ title, updated_by, text }) => (
async (dispatch) => { async (dispatch) => {
try { try {
const response = await axios.post('/api/v1/news/', { const response = await axios.post('/api/v1/news/', {
author, updated_by,
title, title,
text, text,
}); });
......
...@@ -14,7 +14,7 @@ class AddNewsForm extends Component { ...@@ -14,7 +14,7 @@ class AddNewsForm extends Component {
render() { render() {
const { title, text } = this.props.newNews; const { title, text } = this.props.newNews;
const author = this.props.user.id; const updated_by = this.props.user.id;
return ( return (
<Modal <Modal
open={this.state.showModal} open={this.state.showModal}
...@@ -60,7 +60,7 @@ class AddNewsForm extends Component { ...@@ -60,7 +60,7 @@ class AddNewsForm extends Component {
inverted inverted
color='green' color='green'
onClick={() => { onClick={() => {
this.props.postNews({ title, text, author }); this.props.postNews({ title, text, updated_by });
this.setState({ showModal: false }); this.setState({ showModal: false });
this.props.clearWrite(); this.props.clearWrite();
}} }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment