sort fix
This commit is contained in:
@@ -107,8 +107,12 @@ async def load_shouts_by(_, info, options):
|
||||
)
|
||||
user = info.context["request"].user
|
||||
q = apply_filters(options.get("filters"), q, user)
|
||||
|
||||
order_by = extract_order(options.get("order_by"), q)
|
||||
query_order_by = desc(order_by) if options.get("order_by_desc") else asc(order_by)
|
||||
|
||||
order_by_desc = True if options.get('order_by_desc') is None else options.get('order_by_desc')
|
||||
|
||||
query_order_by = desc(order_by) if order_by_desc else asc(order_by)
|
||||
offset = options.get("offset", 0)
|
||||
limit = options.get("limit", 10)
|
||||
q = q.group_by(Shout.id).order_by(query_order_by).limit(limit).offset(offset)
|
||||
|
Reference in New Issue
Block a user