Skip to content
Snippets Groups Projects
Commit 4b22d59f authored by meskio's avatar meskio :tent:
Browse files

Sort transactions by date

parent 4d3292e1
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ func (a *api) ListTransactions(w http.ResponseWriter, req *http.Request) {
var transactions []Transaction
err := a.db.Preload("Purchase.Product").
Preload(clause.Associations).
Order("date desc").
Find(&transactions).Error
if err != nil {
log.Printf("Can't list transactions: %v", err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment