sorting events in backend by date

This commit is contained in:
z1glr
2025-04-01 23:03:11 +02:00
parent 9941b1526c
commit 7b15cfbd77
2 changed files with 3 additions and 3 deletions

View File

@@ -220,7 +220,7 @@ func Update(event EventPatch) error {
func All() ([]EventData, error) {
var dbRows []EventData
if err := db.DB.Select(&dbRows, "SELECT * FROM EVENTS"); err != nil {
if err := db.DB.Select(&dbRows, "SELECT * FROM EVENTS ORDER BY date"); err != nil {
return nil, err
} else {
return dbRows, nil