-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inspiration board Katherine #39
base: master
Are you sure you want to change the base?
Conversation
Inspiration BoardWhat We're Looking For
|
|
||
this.state = { | ||
cards: [], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also set the state of the error messages here, otherwise the push will fail.
}) | ||
.catch((error) => { | ||
let { errors } = this.state | ||
errors.push(error.message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail, unless errors
is initialized prior, or you use the |=
operator.
// What should we do when we know the post request worked? | ||
console.log('we definitely have a new card!', cardData); | ||
|
||
const updatedBoard = [ ...this.state.cards, cardData] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing the id
for cardData
here.
You should have:
cardData.id = response.data.card.id;
Inspiration Board
Congratulations! You're submitting your assignment!
Comprehension Questions