products.py 293 B

12345678910
  1. from fastapi.responses import JSONResponse
  2. from services.data_service import all_products
  3. from logging import getLogger
  4. logger = getLogger(__name__)
  5. async def get_products():
  6. """Get products"""
  7. logger.info("Fetching all products")
  8. return JSONResponse({"products": all_products})