Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <Route component={AppHeader} />
  2. {["/articles/:id/edit", "/articles/new"].map((path, index) =>
  3. <Route key={index} exact path={path} component{ArticleForm}/>
  4. )}
  5. <Route exact path="/articles/:id" component={Article}/>
  6. {["/", "/articles"].map((path, index) =>
  7. <Route key={index} exact path={path} component{ArticlesList}/>
  8. )}
  9.  
  10. export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Component))
  11.  
  12. deleteArticle = async () => {
  13. await ajaxHelpers.ajaxCall('DELETE',`/articles/${this.state.currentArticleID}`, {}, this.state.token)
  14. this.props.history.push("/")
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement