shours order hotfix
This commit is contained in:
parent
8975e003a9
commit
566005264d
|
@ -107,7 +107,9 @@ async def load_shouts_by(_, info, options):
|
||||||
|
|
||||||
order_by = options.get("order_by") if options.get("order_by") else 'createdAt'
|
order_by = options.get("order_by") if options.get("order_by") else 'createdAt'
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
q = q.group_by(Shout.id).order_by(query_order_by).limit(options.get("limit")).offset(
|
q = q.group_by(Shout.id).order_by(query_order_by).limit(options.get("limit")).offset(
|
||||||
options.get("offset") if options.get("offset") else 0)
|
options.get("offset") if options.get("offset") else 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user