Skip to content

Commit

Permalink
fix add_robot -> add/robot
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Jun 5, 2024
1 parent e994314 commit c35f520
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/hooks/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class api {
public async addRobot(robot: Robot): Promise<void> {
const s = robot.name;
try {
await this.api.post("/add_robot/", robot);
await this.api.post("/add/robot/", robot);
} catch (error) {
if (axios.isAxiosError(error)) {
console.error("Error adding robot:", error.response?.data);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Home = () => {
width: "100%",
}}
onClick={() => {
navigate("/add_robot");
navigate("/add/robot");
}}
>
Make a Robot
Expand Down
2 changes: 1 addition & 1 deletion store/app/api/routers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async def list_parts(crud: Annotated[Crud, Depends(Crud.get)]) -> List[Part]:


@api_router.post("/add/robot/")
async def add_robot(robot: Robot, crud: Annotated[Crud, Depends(Crud.get)]) -> Dict[str, str]:
async def add/robot(robot: Robot, crud: Annotated[Crud, Depends(Crud.get)]) -> Dict[str, str]:
table = await crud.db.Table("Robots")
await table.put_item(Item=robot.model_dump())
return {"message": "Robot added successfully"}
Expand Down

0 comments on commit c35f520

Please sign in to comment.