From ff3d0af513479eedbc32725dd1871d96015ea471 Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Mon, 30 Aug 2021 17:03:39 +0200 Subject: [PATCH] Make Ascending the default sort direction. This solves #366 --- api/graphql/models/utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/graphql/models/utils.go b/api/graphql/models/utils.go index ba1345d..38cb081 100644 --- a/api/graphql/models/utils.go +++ b/api/graphql/models/utils.go @@ -21,10 +21,10 @@ func FormatSQL(tx *gorm.DB, order *Ordering, paginate *Pagination) *gorm.DB { } if order != nil && order.OrderBy != nil { - desc := true + desc := false if order.OrderDirection != nil && order.OrderDirection.IsValid() { - if *order.OrderDirection == OrderDirectionAsc { - desc = false + if *order.OrderDirection == OrderDirectionDesc { + desc = true } }