about summary refs log tree commit diff
path: root/src/db
diff options
context:
space:
mode:
authorhanemile <mail@emile.space>2020-07-19 16:44:00 +0200
committerhanemile <mail@emile.space>2020-07-19 16:44:00 +0200
commit508097bd45862195ab45e2179806af78084b83b1 (patch)
treec488504ff736106ff3655f341dfa2a1f26d1d92e /src/db
parent81afd93803c5478d36fab196eaae25bef6788b11 (diff)
sorting upcoming talks ascending instead of descending
Diffstat (limited to 'src/db')
-rw-r--r--src/db/talk.go4
1 files changed, 2 insertions, 2 deletions
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)
 	}