1
Fork 0

Make Ascending the default sort direction.

This solves #366
This commit is contained in:
viktorstrate 2021-08-30 17:03:39 +02:00
parent 293ac99709
commit ff3d0af513
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
1 changed files with 3 additions and 3 deletions

View File

@ -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
}
}