feat: add step thumbs feedback and /ratings alias routes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -554,6 +554,42 @@ async def delete_rating(
|
||||
return None
|
||||
|
||||
|
||||
# Backward-compatible /ratings alias routes
|
||||
@router.post("/{step_id}/ratings", response_model=StepRatingResponse, status_code=201,
|
||||
include_in_schema=False)
|
||||
async def rate_step_alias(
|
||||
step_id: UUID,
|
||||
rating_data: StepRatingCreate,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user: User = Depends(get_current_active_user)
|
||||
):
|
||||
"""Alias for POST /{step_id}/rate."""
|
||||
return await rate_step(step_id, rating_data, db, current_user)
|
||||
|
||||
|
||||
@router.put("/{step_id}/ratings", response_model=StepRatingResponse,
|
||||
include_in_schema=False)
|
||||
async def update_rating_alias(
|
||||
step_id: UUID,
|
||||
rating_data: StepRatingUpdate,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user: User = Depends(get_current_active_user)
|
||||
):
|
||||
"""Alias for PUT /{step_id}/rate."""
|
||||
return await update_rating(step_id, rating_data, db, current_user)
|
||||
|
||||
|
||||
@router.delete("/{step_id}/ratings", status_code=204,
|
||||
include_in_schema=False)
|
||||
async def delete_rating_alias(
|
||||
step_id: UUID,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user: User = Depends(get_current_active_user)
|
||||
):
|
||||
"""Alias for DELETE /{step_id}/rate."""
|
||||
return await delete_rating(step_id, db, current_user)
|
||||
|
||||
|
||||
@router.get("/{step_id}/reviews", response_model=list[StepRatingResponse])
|
||||
async def get_reviews(
|
||||
step_id: UUID,
|
||||
|
||||
Reference in New Issue
Block a user