Add full-stack API-backed wishlist feature#6
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
…art buttons, and Wishlist page Agent-Logs-Url: https://github.com/thomasiverson/GitHubCopilot_Customized/sessions/29968f7b-c4e2-4b44-bf7b-a0351299f5eb Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Agent-Logs-Url: https://github.com/thomasiverson/GitHubCopilot_Customized/sessions/29968f7b-c4e2-4b44-bf7b-a0351299f5eb Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add backend API for wishlist feature
Add full-stack API-backed wishlist feature
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a complete wishlist feature: in-memory REST API with Swagger docs, React Query-powered context, heart button on product cards, dedicated wishlist page, and nav link with count badge.
Backend (
api/)models/wishlist.ts—WishlistIteminterface (userId: string,productId: number,addedAt: string) with Swagger schema annotationroutes/wishlist.ts— In-memory store; three endpoints with full Swagger JSDoc:GET /api/wishlist?userId=— 400 ifuserIdmissingPOST /api/wishlist— 409 on duplicateDELETE /api/wishlist/:productId?userId=— 404 if not foundresetWishlist()for test isolationroutes/wishlist.test.ts— 8 Vitest/Supertest tests covering happy paths and all error casesindex.ts— Mounts router at/api/wishlistFrontend (
frontend/)AuthContext— AddsuserEmail: string | null; set onlogin(), cleared onlogout()WishlistContext— Fetches wishlist via React Query (enabledwhen logged in); exposeswishlistProductIds(memoizedSet<number>),toggleWishlist(useCallback, calls POST or DELETE),isWishlisted,wishlistCountProducts.tsx— Heart button in image top-right; filled green (text-primary fill-primary) when wishlisted, outline gray otherwise;aria-labelreflects add/remove state; stops click propagationWishlist.tsx— Filters all products to wishlisted ones; empty state: "Your wishlist is empty — browse products to save items for later"; same card layout with heart buttonApp.tsx— Wraps tree in<WishlistProvider>; adds<Route path="/wishlist">Navigation.tsx— Wishlist link visible only whenisLoggedIn; count badge whenwishlistCount > 0api/config.ts— Addswishlist: '/api/wishlist'endpoint constantOriginal prompt