commit e0ffeaf3b5b4d6fc8732449e33f8b5f2fa0e2602
parent 1cefaf84b9b2509a9d6ea534393450dff9a49a77
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Wed, 7 Aug 2024 15:02:17 -0700
Sort floorplans, with recently updated coming first
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/internal/backend/floorplan.go b/internal/backend/floorplan.go
@@ -56,7 +56,8 @@ func (e *Env) GetFloorplan(tx *sql.Tx, user string, name string) (*Floorplan, er
}
func (e *Env) GetFloorplans(tx *sql.Tx, user string) ([]Floorplan, error) {
- stmt, err := e.CacheTxStmt(tx, "get_floorplans", "SELECT * FROM spaceplanner.floorplans WHERE owner = $1")
+ stmt, err := e.CacheTxStmt(tx, "get_floorplans", `SELECT * FROM spaceplanner.floorplans WHERE owner = $1
+ ORDER BY updated DESC, created DESC`)
if err != nil {
return nil, err
}