"""Delete utilities for tickets and sprints."""

from fastapi import HTTPException


def delete_item(delete_func, item_id: str, not_found_msg: str):
    """Generic delete function for tickets and sprints."""
    if delete_func(item_id):
        return {"ok": True}
    raise HTTPException(404, not_found_msg)
