This commit is contained in:
2022-11-16 10:32:24 +03:00
parent edb68dc0dd
commit 2dd6327edd
6 changed files with 36 additions and 33 deletions

View File

@@ -185,7 +185,7 @@ async def get_authors_all(_, _info):
@query.field("loadAuthorsBy")
async def load_authors_by(_, info, by, amount, offset):
async def load_authors_by(_, info, by, limit, offset):
authors = []
with local_session() as session:
aq = session.query(User)
@@ -206,7 +206,7 @@ async def load_authors_by(_, info, by, amount, offset):
User.id
).order_by(
by.get("order") or "createdAt"
).limit(amount).offset(offset)
).limit(limit).offset(offset)
authors = list(map(lambda r: r.User, session.execute(aq)))
if by.get("stat"):
for a in authors: