Implement settings api
This commit is contained in:
9
app.go
9
app.go
@@ -20,6 +20,7 @@ func (a *App) startup(ctx context.Context) {
|
||||
a.ctx = ctx
|
||||
}
|
||||
|
||||
// region food
|
||||
func (a *App) GetFood() WailsFood {
|
||||
data, err := foodService.GetRecent()
|
||||
if err != nil {
|
||||
@@ -42,4 +43,12 @@ func (a *App) UpdateFood(food Food) WailsFood1 {
|
||||
return WailsFood1{Success: false, Error: err.Error()}
|
||||
}
|
||||
return WailsFood1{Data: data, Success: true}
|
||||
}
|
||||
|
||||
// region settings
|
||||
func (a *App) GetSettings() settings {
|
||||
return Settings
|
||||
}
|
||||
func (a *App) SetSetting(key string, value any) settings {
|
||||
return settingsService.Set(key, value)
|
||||
}
|
Reference in New Issue
Block a user