|
|
|
@ -54,12 +54,12 @@ fetch('https://stupidcomments.herokuapp.com/comments').then((response)=>{
|
|
|
|
|
|
|
|
|
|
|
|
## Dispatch an ADD action appropriately
|
|
|
|
## Dispatch an ADD action appropriately
|
|
|
|
|
|
|
|
|
|
|
|
In `js/components/commentsform.jsx` alter the `handleSubmit` property to make an AJAX POST request:
|
|
|
|
In `js/components/commentsform.jsx` alter the `createComment` property to make an AJAX POST request:
|
|
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
```javascript
|
|
|
|
const mapDispatchToProps = function(dispatch){
|
|
|
|
const mapDispatchToProps = function(dispatch){
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
handleSubmit: function(comment){
|
|
|
|
createComment: function(comment){
|
|
|
|
fetch(
|
|
|
|
fetch(
|
|
|
|
'https://stupidcomments.herokuapp.com/comments',
|
|
|
|
'https://stupidcomments.herokuapp.com/comments',
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|