Skip to content

Commit

Permalink
fix(api): decorator variable must match the function argument (#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilsbole authored Dec 3, 2024
1 parent b26f6c7 commit ae47dd0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/routers/user_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def add_user_template(
raise HTTPException(status_code=409, detail="Template by this name already exists")


@router.get("/user_template/{id}", response_model=UserTemplateResponse)
@router.get("/user_template/{template_id}", response_model=UserTemplateResponse)
def get_user_template_endpoint(
dbuser_template: UserTemplateResponse = Depends(get_user_template),
admin: Admin = Depends(Admin.get_current)):
"""Get User Template information with id"""
return dbuser_template


@router.put("/user_template/{id}", response_model=UserTemplateResponse)
@router.put("/user_template/{template_id}", response_model=UserTemplateResponse)
def modify_user_template(
modify_user_template: UserTemplateModify,
db: Session = Depends(get_db),
Expand All @@ -62,7 +62,7 @@ def modify_user_template(
raise HTTPException(status_code=409, detail="Template by this name already exists")


@router.delete("/user_template/{id}")
@router.delete("/user_template/{template_id}")
def remove_user_template(
db: Session = Depends(get_db),
admin: Admin = Depends(Admin.check_sudo_admin),
Expand All @@ -74,10 +74,10 @@ def remove_user_template(

@router.get("/user_template", response_model=List[UserTemplateResponse])
def get_user_templates(
offset: int = None,
limit: int = None,
offset: int = None,
limit: int = None,
db: Session = Depends(get_db),
admin: Admin = Depends(Admin.get_current)
):
"""Get a list of User Templates with optional pagination"""
return crud.get_user_templates(db, offset, limit)
return crud.get_user_templates(db, offset, limit)

0 comments on commit ae47dd0

Please sign in to comment.