From 508097bd45862195ab45e2179806af78084b83b1 Mon Sep 17 00:00:00 2001 From: hanemile Date: Sun, 19 Jul 2020 16:44:00 +0200 Subject: sorting upcoming talks ascending instead of descending --- src/db/talk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/db/talk.go b/src/db/talk.go index 9693d0c..216bf13 100644 --- a/src/db/talk.go +++ b/src/db/talk.go @@ -22,7 +22,7 @@ func InsertTalk(db *pg.DB, talk *structs.Talk) error { // UpcomingTalksLimited returns the next 3 upcoming talks func UpcomingTalksLimited(db *pg.DB) ([]structs.Talk, error) { var talks []structs.Talk - err := db.Model(&talks).Order("date DESC").Where("date > ?", time.Now()).Limit(3).Select() + err := db.Model(&talks).Order("date ASC").Where("date > ?", time.Now()).Limit(3).Select() if err != nil { return []structs.Talk{}, fmt.Errorf("could not get the talks from the db: %s", err) } @@ -33,7 +33,7 @@ func UpcomingTalksLimited(db *pg.DB) ([]structs.Talk, error) { // UpcomingTalks returns the next upcoming talks func UpcomingTalks(db *pg.DB) ([]structs.Talk, error) { var talks []structs.Talk - err := db.Model(&talks).Order("date DESC").Where("date > ?", time.Now()).Select() + err := db.Model(&talks).Order("date ASC").Where("date > ?", time.Now()).Select() if err != nil { return []structs.Talk{}, fmt.Errorf("could not get the talks from the db: %s", err) } -- cgit 1.4.1