Rework lastper100 to return a food instead of float32

This commit is contained in:
2024-08-13 15:31:50 +02:00
parent abb25c1357
commit 6bfd5cc26a
4 changed files with 11 additions and 27 deletions

6
app.go
View File

@@ -44,12 +44,12 @@ func (a *App) UpdateFood(food Food) WailsFood1 {
return WailsFood1{Data: data, Success: true}
}
func (a *App) GetLastPer100(name string) WailsPer100 {
func (a *App) GetLastPer100(name string) WailsFood1 {
data, err := foodService.GetLastPer100(name)
if err != nil {
return WailsPer100{Success: false, Error: err.Error()}
return WailsFood1{Success: false, Error: err.Error()}
}
return WailsPer100{Data: data, Success: true}
return WailsFood1{Data: data, Success: true}
}
func (a *App) GetDailyFood() WailsAggregateFood {