Commit e4e2ff3
committed
feat(wishlist): implement complete wishlist API with JWT authentication
- Add Wishlist model with user reference and product IDs
- Implement wishlist controller with CRUD operations
- Add JWT authentication middleware
- Create wishlist routes with proper validation
- Add test token generation endpoint for development
- Prevent duplicate products in wishlist
- Handle edge cases (empty wishlist, invalid IDs)
- Integrate wishlist routes into main app
- Add .DS_Store to .gitignore
Endpoints:
- GET /api/wishlist - Get user's wishlist
- POST /api/wishlist - Add product to wishlist
- DELETE /api/wishlist/:productId - Remove product
- DELETE /api/wishlist - Clear entire wishlist
- GET /api/test/token - Generate test JWT token3 files changed
Lines changed: 3 additions & 2 deletions
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments