move method

This commit is contained in:
Valentin CZERYBA 2023-11-02 17:30:15 +01:00
parent 2546763b03
commit a279439e72

View File

@ -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
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