From caa223bd6f25c0b62c5fa9dcb476ddaa68d2ef3a Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Wed, 13 Apr 2022 23:18:23 +0300 Subject: [PATCH] main: remove redundant url path parameters Signed-off-by: HeshamTB --- sql_app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql_app/main.py b/sql_app/main.py index e3f35b1..fd03c58 100644 --- a/sql_app/main.py +++ b/sql_app/main.py @@ -87,7 +87,7 @@ def read_user(user_id: int, db: Session = Depends(get_db)): return db_user # Add admin, disable user, activeate user -@app.post("/admin/users/{user_id}/allow/{iot_entity_id}", tags=['Admin']) +@app.post("/admin/users/allowdevice/", tags=['Admin']) def allow_user_for_iot_entity(request: schemas.UserAllowForIotEntityRequest, db: Session = Depends(get_db)): user = crud.get_user(db, request.user_id) if not user: @@ -103,7 +103,7 @@ def allow_user_for_iot_entity(request: schemas.UserAllowForIotEntityRequest, db: return -@app.post("/admin/users/{user_id}/disallow/{iot_entity_id}", tags=['Admin']) +@app.post("/admin/users/disallowdevice/", tags=['Admin']) def allow_user_for_iot_entity(request: schemas.UserAllowForIotEntityRequest, db: Session = Depends(get_db)): user = crud.get_user(db, request.user_id) if not user: