swag-shop/backend/app/routes/cart_routes.py

39 lines
764 B
Python
Raw Permalink Normal View History

from fastapi import APIRouter, Query
router = APIRouter(
prefix="/cart",
tags=["Cart"]
)
@router.get("/")
async def show_cart():
raise NotImplementedError
@router.put("/add/{product_id}")
async def add_to_cart(
product_id: int,
count: int = Query(
1, ge=1, description="Count must be greater than or equal to 1")
):
raise NotImplementedError
@router.delete("/remove/{product_id}")
async def remove_from_cart(product_id: int):
raise NotImplementedError
@router.put("/update/{product_id}")
async def update_count_in_cart(
product_id: int,
count: int = Query(..., description="Count must be provided")
):
raise NotImplementedError
@router.get("/purchase")
async def purchase():
raise NotImplementedError