dev-0hpc7y/endpoints/books.delete.py
2025-04-25 09:03:22 +00:00

14 lines
573 B
Python

# Simplified DELETE template
from fastapi import APIRouter, Depends, HTTPException, status
router = APIRouter()
@router.delete("/books", status_code=status.HTTP_204_NO_CONTENT) # Operates on the base path
async def delete_books( # Function name reflects resource (plural)
# db: Session = Depends(get_db) # Example dependency
):
"""Endpoints for books: Delete resource(s)"""
# TODO: Implement logic to delete books (e.g., clear collection or delete specific item based on criteria?)
print(f"Deleting books")
return None # Return No Content on success