aboutsummaryrefslogtreecommitdiff
path: root/cmd/mi/models
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-06-11 13:12:45 -0400
committerXe Iaso <me@xeiaso.net>2024-06-11 13:12:53 -0400
commita2b1bde64cbdb14a08a1c3c821ca645768e23a29 (patch)
treec061b2d3b3641bfe5494a605d996b884768eddb0 /cmd/mi/models
parent15898fc13277fcb0a35de56aab792f2e194c712c (diff)
downloadx-a2b1bde64cbdb14a08a1c3c821ca645768e23a29.tar.xz
x-a2b1bde64cbdb14a08a1c3c821ca645768e23a29.zip
cmd/mi/models: order UpcomingEvents by StartDate
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/mi/models')
-rw-r--r--cmd/mi/models/events.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/mi/models/events.go b/cmd/mi/models/events.go
index 0e60fb9..3577a89 100644
--- a/cmd/mi/models/events.go
+++ b/cmd/mi/models/events.go
@@ -54,6 +54,7 @@ func (d *DAO) UpcomingEvents(ctx context.Context, count int) ([]Event, error) {
WithContext(ctx).
Where("end_date >= ?", time.Now()).
Limit(count).
+ Order("start_date").
Find(&events).Error; err != nil {
return nil, err
}