fase 7 afgeronf
This commit is contained in:
@@ -170,3 +170,26 @@ def rename_execute(
|
||||
return service.execute_rename(normalized_session_id, confirm=confirm)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc))
|
||||
|
||||
|
||||
@router.get("/rename-log")
|
||||
def get_rename_log(
|
||||
session_id: str = Query("default", min_length=1),
|
||||
limit: int = Query(20, ge=1, le=200),
|
||||
):
|
||||
service = SessionService()
|
||||
normalized_session_id = _normalize_session_id(session_id)
|
||||
items = service.list_rename_runs(normalized_session_id, limit=limit)
|
||||
return {
|
||||
"session_id": normalized_session_id,
|
||||
"items": items,
|
||||
}
|
||||
|
||||
|
||||
@router.get("/rename-log/{run_id}")
|
||||
def get_rename_log_run(run_id: int):
|
||||
service = SessionService()
|
||||
run = service.get_rename_run(run_id)
|
||||
if run is None:
|
||||
raise HTTPException(status_code=404, detail="rename run not found")
|
||||
return run
|
||||
|
||||
Reference in New Issue
Block a user