Order food by date
This commit is contained in:
@@ -36,7 +36,7 @@ func (s *FoodService) GetRecent() ([]Food, error) {
|
|||||||
return res, fmt.Errorf("cannot get recent food, db is nil or is not ready")
|
return res, fmt.Errorf("cannot get recent food, db is nil or is not ready")
|
||||||
}
|
}
|
||||||
|
|
||||||
row, err := s.db.readConn.Query(fmt.Sprintf("SELECT %s from foodView WHERE date > datetime('now', '-%d days')", foodColumns, Settings.FoodDaysLookback))
|
row, err := s.db.readConn.Query(fmt.Sprintf("SELECT %s from foodView WHERE date > datetime('now', '-%d days') order by date desc;", foodColumns, Settings.FoodDaysLookback))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error getting daily food: %v", err)
|
log.Printf("error getting daily food: %v", err)
|
||||||
return res, err
|
return res, err
|
||||||
|
@@ -1 +1 @@
|
|||||||
21885a85602de6e2fc03dfdb5659741e
|
0539f67989f30cc4f97afd5c6035bcad
|
Reference in New Issue
Block a user