-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: add library favorites #519
Conversation
eb370cd
to
f36617e
Compare
Couple more things I need to figure out, just involving moving the Unfavoriting to the Favorites Card. I'm tapping out tonight. Sorry. I'll make sure its done tomorrow. ASAP. |
f36617e
to
f3c628a
Compare
Ok Ok @calisio <- I switched the unfavoriting into the card, sorry, it should have been that way in the first place. The payload is necessary because of the way that the unfavoriting works on the backend...but I did switch change as much as I could...the bug with the Admin switching back to student view was fixed, double checked and the favorites are still being returned to you in order of most recently favorited, but that handler did change slightly to add the pagination. |
I think besides those comments, everything else is looking good (as long as @PThorpe92 thinks the backend looks good!) |
fdd72f4
to
a55a8f2
Compare
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.
backend looks good 👍
Sweeet! I just force pushed those updates @calisio |
Description of the change
This feature adds the ability for users to favorite libraries. A user clicks the star icon in the right hand corner of the LibraryCard component located in the Libraries tab of Open Content, and that Library is added to the library_favorites table. This also opens up two endpoints in handlers/open_content.go, GET /api/open-content/favorites and PUT /api/open-content/{id}/save. The GET requests returns a users favorites in the order of most recently favorited. The PUT handler checks the database and either adds a favorite row in the library_favorites table for that library and that user, and or soft-deletes the favorite from the library_favorites table if an entry for that user, and that library is already present. The favorites tab combined Video favorites and Library favorites into one cumulative page so that a user can view all of their open content favorites.
Screenshot(s)
Additional context
A couple unrelated changes were changing the videos favoriting icon from a bookmark to a star, and also adding an explicit favorite route for videos because the prior implementation checked an {action} which required admin privileges with the new feature flagging, this made it impossible for users to favorite a video, so that was changed and added as well.