summaryrefslogtreecommitdiff
path: root/model/recipes.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/recipes.go')
-rw-r--r--model/recipes.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/model/recipes.go b/model/recipes.go
index e4fd1b8..09b51e7 100644
--- a/model/recipes.go
+++ b/model/recipes.go
@@ -7,13 +7,21 @@ import (
)
type RecipesElement struct {
- Id int64 // TODO change to string
- Title string
- IsFavorite bool
+ Id int64 `json:"id"` // TODO change to string
+ Title string `json:"title"`
+ IsFavorite bool `json:"is_favorite"`
}
type Recipes []RecipesElement
+func NewRecipes() Object {
+ return &Recipes{}
+}
+
+func (r *Recipes) SetID(id int) {
+ // singleton object, ignoring ID
+}
+
func (r *Recipes) Create(tx *sql.Tx) error {
return fmt.Errorf("Impossible to create a recipe list")
}