diff --git a/app.go b/app.go index b392579..de048a1 100644 --- a/app.go +++ b/app.go @@ -20,6 +20,10 @@ func (a *App) startup(ctx context.Context) { a.ctx = ctx } -func (a *App) GetFood() ([]Food, error) { - return foodService.GetRecent() +func (a *App) GetFood() WailsFood { + data, err := foodService.GetRecent() + if err != nil { + return WailsFood{Success: false, Error: err.Error()} + } + return WailsFood{Data: data, Success: true} } \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index b7e722b..8f2caea 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,9 +1,6 @@