Pass error to svelte using a struct

...a very cursed struct
This commit is contained in:
2024-08-09 18:15:08 +02:00
parent 2fe3bdbb8a
commit b7760c0942
7 changed files with 108 additions and 24 deletions

33
wailstypes.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import "time"
type (
// Wails doesn't rlike generics... Fuck...
// WailsReturn[T interface{}] struct {
// Data T `json:'data'`
// Success bool `json:'success'`
// Error string `json:'error'`
// }
WailsFood struct {
Data []Food `json:"data"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
WailsAggregateFood struct {
Data []AggregatedFood `json:"data"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
Weight struct {
rowid int
date time.Time
weight float32
}
AggregatedWeight struct {
period string
amount float32
}
)