get all users in database

This commit is contained in:
Valentin CZERYBA 2023-10-13 23:32:54 +02:00
parent c95e7aa546
commit d7e9477572

View File

@ -10,8 +10,9 @@ router = APIRouter()
async def read_users(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))]):
listUsers = []
user_repository = users.UserRepository(database=database.database)
for fake in users_active.fake_users:
user = users.UserOut(id=fake["id"], username=fake["username"], disabled=fake["disabled"], roles=fake["roles"])
for fake in user_repository.find_by({}):
print(fake)
user = users.UserOut(id=fake.id, username=fake.username, disabled=fake.disabled, roles=fake.roles)
listUsers.append(user)
return listUsers