From 3a57e7dfb8d1ffa900d361af09aab5c77ec32d1c Mon Sep 17 00:00:00 2001 From: JeseungLee Date: Sat, 20 Oct 2018 23:33:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B7=B8=EB=9E=98=EB=8F=84=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=84=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PostViewFooter/PostViewFooter.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/components/PostViewFooter/PostViewFooter.js b/src/components/PostViewFooter/PostViewFooter.js index 164c0e3..17b48b3 100644 --- a/src/components/PostViewFooter/PostViewFooter.js +++ b/src/components/PostViewFooter/PostViewFooter.js @@ -16,10 +16,9 @@ class PostViewFooter extends Component { .then(res => { res.json().then(data => { this.setState({ + dataCheck: true, data: data.replies }); - //console.log(data); - console.log(this.state.data); }); }) .catch(err => { @@ -28,9 +27,6 @@ class PostViewFooter extends Component { } } render() { - //console.log(this.state); - //const replyData = this.props.data.replies; - //console.log(replyData); return (
@@ -54,19 +50,20 @@ class PostViewFooter extends Component {
- {this.state.data.map((reply, i) => { - return ( - - ); - })} + {this.state.dataCheck && + this.state.data.map((reply, i) => { + return ( + + ); + })}
); From 5bd539156965d26774be2fd24452f192cc5186d2 Mon Sep 17 00:00:00 2001 From: JeseungLee Date: Sun, 21 Oct 2018 00:18:28 +0900 Subject: [PATCH 2/2] ddd --- src/components/Reply/Reply.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Reply/Reply.js b/src/components/Reply/Reply.js index c176069..976cbf0 100644 --- a/src/components/Reply/Reply.js +++ b/src/components/Reply/Reply.js @@ -4,6 +4,14 @@ import { IconContext } from 'react-icons'; import { GoTrashcan } from 'react-icons/go/'; import { GoTools } from 'react-icons/go/'; +const deleteReply = reply_Id => { + fetch('http://localhost:9090/api/reply' + reply_Id); +}; + +const modifyReply = reply_Id => { + fetch('http://localhost:9090/api/reply' + reply_Id); +}; + class Reply extends Component { // console.log('reply : ' + JSON.stringify(data[0])); //console.log(JSON.stringify(data)); @@ -30,7 +38,10 @@ class Reply extends Component {
{content}
-
+
-
+