Commit 32a5d5a6 by Trevor Austin

Refresh posts after posting a new post

parent 57d04ba7
......@@ -45,6 +45,7 @@ class Compose extends React.Component {
}).then(() => {
document.getElementById("compose_title").value = "";
document.getElementById("compose_body").value = "";
this.props.getPosts();
});
}
......@@ -172,7 +173,7 @@ class Journal extends React.Component {
loginHandler={this.loginHandler}
logoutHandler={this.logoutHandler}
/>
{isLoggedIn && <Compose />}
{isLoggedIn && <Compose getPosts={this.getPosts} />}
{isLoggedIn && <Posts posts={this.state.posts} getPosts={this.getPosts} />}
</div>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment