From d43401dc62d99ec81d886679a3d0fcb44d103226 Mon Sep 17 00:00:00 2001 From: kalipso Date: Fri, 11 Apr 2025 13:59:36 +0200 Subject: [PATCH] fix edititem --- controllers/shopItemController.go | 9 ++++++++- views/edititem.html | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/controllers/shopItemController.go b/controllers/shopItemController.go index ce3ff9f..79a44e4 100644 --- a/controllers/shopItemController.go +++ b/controllers/shopItemController.go @@ -106,6 +106,8 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop fmt.Println("Error during pdftoppm: ", err.Error()) } } + } else { + fmt.Println(err) } if name == "" || description == "" { @@ -154,6 +156,8 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop PrintMode: printMode, } + fmt.Println("Creating Shopitem: ", shopItem) + for _, tagId := range tagIds { tag, err := repositories.Tags.GetById(tagId) @@ -447,10 +451,13 @@ func (rc *shopItemController) EditItemHandler(c *gin.Context) { newShopItem.Name = shopItem.Name newShopItem.Abstract = shopItem.Abstract newShopItem.Description = shopItem.Description + newShopItem.Category = shopItem.Category + newShopItem.Variants = shopItem.Variants newShopItem.BasePrice = shopItem.BasePrice newShopItem.IsPublic = shopItem.IsPublic newShopItem.Tags = shopItem.Tags - newShopItem.Variants = shopItem.Variants + newShopItem.Image = shopItem.Image + newShopItem.Pdf = shopItem.Pdf newShopItem.PrintMode = shopItem.PrintMode tags, err := repositories.Tags.GetAll() diff --git a/views/edititem.html b/views/edititem.html index 5bf068d..1a779c1 100644 --- a/views/edititem.html +++ b/views/edititem.html @@ -8,7 +8,7 @@
-
+