admin home: display latest release, not first (oops)
This commit is contained in:
parent
31a02a12a5
commit
94774352b3
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ func GetAllReleases(db *sqlx.DB, onlyVisible bool, limit int, full bool) ([]*mod
|
|||
func GetLatestRelease(db *sqlx.DB) (*model.Release, error) {
|
||||
var release = model.Release{}
|
||||
|
||||
err := db.Get(&release, "SELECT * FROM musicrelease WHERE visible=true ORDER BY release_date LIMIT 1")
|
||||
err := db.Get(&release, "SELECT * FROM musicrelease WHERE visible=true ORDER BY release_date DESC LIMIT 1")
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "no rows") {
|
||||
return nil, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue