fix delete user

This commit is contained in:
Valentin CZERYBA 2023-10-14 18:29:07 +02:00
parent ecc6e7642f
commit 803d0330a1

View File

@ -62,7 +62,7 @@ async def read_users_me(current_user: Annotated[users.User, Depends(users_token.
current_user.disabled = True
if remove is True:
current_user.removed = True
user_repository.update(current_user)
user_repository.save(current_user)
return current_user
@router.delete("/users/{item_id}", tags=["users"], response_model=users.User)
@ -72,5 +72,5 @@ async def read_users_id(item_id : str, authorize: Annotated[bool, Depends(permis
user.disabled = True
if remove is True:
user.removed = True
user_repository.update(user)
user_repository.save(user)
return user