-
Notifications
You must be signed in to change notification settings - Fork 42
Brandy Austin - Inspiration Board - Octos #18
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
base: master
Are you sure you want to change the base?
Conversation
Inspiration BoardWhat We're Looking For
|
|
|
||
| card["id"] = cardInfo[i].card.id | ||
| card["text"] = cardInfo[i].card.text | ||
| card["emoji"] = cardInfo[i].card.emoji |
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 code could probably be simplified to cards.push(cardInfo[i].card);.
| deleteCard = (cardID) => { | ||
|
|
||
| let deleteURL = `${url}${this.props.boardName}/cards/${cardID}`; | ||
| axios.delete(deleteURL); |
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.
It'd probably be best to have then and catch handlers for this delete request. For example, if the delete fails for some reason, we would want to display that information to the user.
|
|
||
| addCard = (card) => { | ||
| let boardURL = `${url}${this.props.boardName}/cards` | ||
| axios.post(boardURL, card); |
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.
Same as with the delete request, we should have then and catch handlers for this.
In particular, its important to have the following code (where we insert the new card into the state) only happen in the then handler, because we don't want to add the card "locally" if the API actually rejected our request.
Comprehension Questions