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 = () => (
}
);
export const postNews = ({ title, author, text }) => (
export const postNews = ({ title, updated_by, text }) => (
async (dispatch) => {
try {
const response = await axios.post('/api/v1/news/', {
author,
updated_by,
title,
text,
});
......
......@@ -14,7 +14,7 @@ class AddNewsForm extends Component {
render() {
const { title, text } = this.props.newNews;
const author = this.props.user.id;
const updated_by = this.props.user.id;
return (
<Modal
open={this.state.showModal}
......@@ -60,7 +60,7 @@ class AddNewsForm extends Component {
inverted
color='green'
onClick={() => {
this.props.postNews({ title, text, author });
this.props.postNews({ title, text, updated_by });
this.setState({ showModal: false });
this.props.clearWrite();
}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment