improve th esorting per item (#23)

This commit is contained in:
Ruidy 2024-11-14 22:45:45 +01:00 committed by GitHub
parent 5d826c21da
commit 42764ab6cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,7 +82,9 @@ func (ps *PgStore) CardTotal(from, to time.Time) (float64, error) {
func (ps *PgStore) Get(id int) *Booking {
b := &Booking{Id: id}
ps.db.Preload("Items").First(b)
ps.db.Preload("Items", func(db *gorm.DB) *gorm.DB {
return db.Order("item")
}).First(b)
return b
}