From c611e7a5f259c6ded9f9c37179d5cade2619c2c9 Mon Sep 17 00:00:00 2001
From: rlacko <rlacko@sch.bme.hu>
Date: Thu, 6 Feb 2020 20:40:28 +0100
Subject: [PATCH] #68 actions postNews params updated

---
 src/actions/news.js                 | 4 ++--
 src/components/forms/AddNewsForm.js | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/actions/news.js b/src/actions/news.js
index 525370c..d096cde 100644
--- a/src/actions/news.js
+++ b/src/actions/news.js
@@ -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,
       });
diff --git a/src/components/forms/AddNewsForm.js b/src/components/forms/AddNewsForm.js
index 0a11032..d2af3b1 100644
--- a/src/components/forms/AddNewsForm.js
+++ b/src/components/forms/AddNewsForm.js
@@ -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();
                     }}
-- 
GitLab