From 357ae512da2c9655041d8da838100219131f1f70 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 6 Sep 2020 16:28:01 +0200 Subject: [PATCH] fixed order direction on columns --- src/qrzws/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qrzws/main.go b/src/qrzws/main.go index 2b11ad4..975c38e 100644 --- a/src/qrzws/main.go +++ b/src/qrzws/main.go @@ -113,9 +113,9 @@ func BuildQuery(config config.Config, qrzdt QrzDatatableInput) (qrz []qrz.Qrz, e return nil, err } - if orderdir == "DESC" { + if orderdir == "desc" { err = config.Db.Where(searchstatement).Limit(limit, offset).Desc(ordercol...).Select(selectstatement).Find(&qrz) - } else if orderdir == "ASC" { + } else if orderdir == "asc" { err = config.Db.Where(searchstatement).Limit(limit, offset).Asc(ordercol...).Select(selectstatement).Find(&qrz) } else { err = config.Db.Where(searchstatement).Limit(limit, offset).Asc("qrz").Select(selectstatement).Find(&qrz)