Skip to content

Commit

Permalink
description parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jan 15, 2025
1 parent 9bb0445 commit dda83e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion www/routers/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ async def add_robot(
user: Annotated[User, Depends(require_permissions({"upload"}))],
robot_class: Annotated[RobotClass, Depends(get_robot_class_by_name)],
crud: Annotated[RobotCrud, Depends(robot_crud)],
description: str | None = Query(
default=None,
description="The description of the robot",
),
) -> RobotResponse:
robot = await crud.add_robot(robot_name, user.id, robot_class.id)
robot = await crud.add_robot(robot_name, user.id, robot_class.id, description)
return RobotResponse.from_robot(robot, robot_class)


Expand Down
6 changes: 5 additions & 1 deletion www/routers/robot_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ async def add_robot_class(
class_name: str,
user: Annotated[User, Depends(require_permissions({"upload"}))],
crud: Annotated[RobotClassCrud, Depends(robot_class_crud)],
description: str | None = Query(
default=None,
description="The description of the robot class",
),
) -> RobotClass:
"""Adds a robot class."""
return await crud.add_robot_class(class_name, user.id)
return await crud.add_robot_class(class_name, user.id, description)


@router.post("/{class_name}")
Expand Down

0 comments on commit dda83e1

Please sign in to comment.