async def update_collection(
    readable_id: str,
    collection: schemas.CollectionUpdate,
    db: AsyncSession = Depends(deps.get_db),
    current_user: User = Depends(deps.get_user),
) -> schemas.Collection:
    """Update a collection by its readable ID."""
    db_obj = await crud.collection.get_by_readable_id(
        db, readable_id=readable_id, current_user=current_user
    )
    if db_obj is None:
        raise HTTPException(status_code=404, detail="Collection not found")
    return await crud.collection.update(
        db, db_obj=db_obj, obj_in=collection, current_user=current_user
    )
Update a collection by its readable ID.
backend/airweave/api/v1/endpoints/collections.py