fix0async

This commit is contained in:
tonyrewin 2022-09-30 11:48:38 +03:00
parent 25bf26e61d
commit 427e700a30

View File

@ -184,12 +184,13 @@ def author_unfollow(user, slug):
@query.field("authorsAll")
def get_authors_all(_, _info):
async def get_authors_all(_, _info):
authors = await UserStorage.get_all_users()
for author in authors:
author.stat = await get_author_stat(author.slug)
return authors
@query.field("topAuthors")
def get_top_authors(_, _info, offset, limit):
return list(UserStorage.get_top_users())[offset : offset + limit] # type: ignore