Create "like" button
amorriscode opened this issue · 0 comments
amorriscode commented
Each learning should have a like button.
We have an icon for "liking" a learning.
- The Learning data model allows likes
- In the Learning service we need to create a method for liking; basically a copy of the update method but we won't have to protect it
- That method should copy the existing likes and simply push a userId (the one in context) into the
likes
array - You can see how to get a user from context on this line of code
- Read about doing
onClick
in React here: https://reactjs.org/docs/handling-events.html; we will want to do that to handle a user clicking