Add wishlist feature and update FitMart#600
Conversation
AnshulSharma-11
left a comment
There was a problem hiding this comment.
Nice implementation of the wishlist feature with a clean separation between UI (WishlistButton), state management (useWishlist) and backend APIs
The optimistic update pattern improves ux
but useWishlist could suffer from stale state issues since wishlistIds is included in the useCallback dependency array
Consider adding loading/error feedback for wishlist actions and validating that users can only access their own wishlist on the backend
|
Thanks for the detailed review! Here's what I've addressed: |
|
Thanks for the thorough implementation and for addressing AnshulSharma-11's review points so promptly! A few observations from looking over the changes: What's well done:
A few things worth considering:
Overall the implementation looks solid. The author has been responsive to feedback which is great to see! |
|
Thank you for the feedback! |
📋 What does this PR do?
Adds a full-stack Wishlist feature that allows authenticated users to save products for later and manage them from a dedicated wishlist page.
📂 File Structure Changes
Backend
server/models/Wishlist.js– Wishlist schemaserver/routes/wishlist.js– Wishlist API routesserver/index.js– Registered/api/wishlistrouteFrontend
client/src/hooks/useWishlist.js– Custom hook for wishlist operationsclient/src/components/WishlistButton.jsx– Reusable wishlist toggle buttonclient/src/pages/WishlistPage.jsx– Wishlist page UIclient/src/components/Navbar.jsx– Wishlist icon with count badgeclient/src/App.jsx– Added/wishlistrouteclient/src/pages/HomePage.jsx– Integrated wishlist functionality🔗 Related Issue
N/A
🧪 How was this tested?
📸 Screenshots (if UI changes)
N/A
✅ Checklist