from fastapi import status from fastapi.responses import JSONResponse def created_response(location: str, message: str = "The item was created successfully"): return JSONResponse( status_code=status.HTTP_201_CREATED, content={"message": message}, headers={"Location": location}, ) def paginated_response(data: list, count: int, page: int, limit: int): return JSONResponse( status_code=status.HTTP_200_OK, content=[item for item in data], headers={ "Pagination-Count": str(count), "Pagination-Page": str(page), "Pagination-Limit": str(limit), }, )