Pass error to svelte using a struct
...a very cursed struct
This commit is contained in:
33
wailstypes.go
Normal file
33
wailstypes.go
Normal 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
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user