26 lines
777 B
Python
26 lines
777 B
Python
"""
|
|
@router WishlistRouter (Backend/app/api/v1/routers/WishlistRouter.py)
|
|
"""
|
|
from fastapi import APIRouter
|
|
from pydantic import BaseModel
|
|
|
|
router = APIRouter(prefix="/api/v1/wishlist", tags=["Customer Wishlist"])
|
|
|
|
class WishlistAddRequest(BaseModel):
|
|
product_id: str
|
|
|
|
@router.get("")
|
|
def get_wishlist():
|
|
return {
|
|
"items": [
|
|
{"product_id": "prd_01J8X9A", "name": "Display Assembly OLED", "price": 149.99}
|
|
]
|
|
}
|
|
|
|
@router.post("/add")
|
|
def add_to_wishlist(payload: WishlistAddRequest):
|
|
return {"message": "Product added to wishlist", "product_id": payload.product_id}
|
|
|
|
@router.post("/remove")
|
|
def remove_from_wishlist(payload: WishlistAddRequest):
|
|
return {"message": "Product removed from wishlist", "product_id": payload.product_id}
|