diff --git a/app/routers/users.py b/app/routers/users.py index e6e0fab..afd8d89 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -169,13 +169,7 @@ async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker user_repository.save(user) return user -@router.patch("/users/enable/{item_id}", tags=["users"], response_model=users.User) -async def patch_users_id(item_id : str, authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))]): - user_repository = users.UserRepository(database=database.database) - user = user_repository.find_one_by_id(ObjectId(item_id)) - user.status = 1 - user_repository.save(user) - return user + @router.patch("/users/groups",tags=["users"]) async def patch_users_groups(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))], userids: list[str] = []): @@ -194,4 +188,12 @@ async def patch_users_groups(authorize: Annotated[bool, Depends(permissions_chec response = JSONResponse(content=content) - return response \ No newline at end of file + return response + +@router.patch("/users/{item_id}", tags=["users"], response_model=users.User) +async def patch_users_id(item_id : str, authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))]): + user_repository = users.UserRepository(database=database.database) + user = user_repository.find_one_by_id(ObjectId(item_id)) + user.status = 1 + user_repository.save(user) + return user \ No newline at end of file