Added functionality to the like button for posts that have a like button (non Yelp)
Like button sends API request to like and unlike
Like button now has a like counter next to it
Added an example like button in the Feed tab
This like button is hardcoded to a specific post
This exists to test the like button without needing the logged in user to be following any other user
This can be removed in future PRs with no worry
Visual changes to the like button will come in a future PR
Changes made to friends.tsx were authored by @noodaj in order to make the Post ID accessible
Portions of this code that utilized AI generation
No AI was used to generate this code since existing documentation and collaboration with other team members was sufficient.
How to Test
Start the Firebase Emulator and backend server
Start the frontend server and run your device emulator
Log into a user
Disable the middleware
Use Postman to follow the "munch" user
Reenable the middleware
Relog into the user you were using
Navigate to the Feed tab
Press the like button in the upper left corner
You should see the API call in the backend terminal and the like count update on the device emulator.
Navigate to the Friends tab
You should see a list of posts. Interact with the like button on a post
You should see the number of likes change. If you check the Firebase Emulator site and you search for the post, you should also see the number of likes change
Checklist
[x] I have added/updated relevant documentation, and I have followed the coding style guidelines.
[x] I have checked for any potential conflicts with other branches and fixed any merge conflicts.
Description / Changes Made
Portions of this code that utilized AI generation
No AI was used to generate this code since existing documentation and collaboration with other team members was sufficient.
How to Test
Checklist