fix edititem
This commit is contained in:
@@ -106,6 +106,8 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop
|
|||||||
fmt.Println("Error during pdftoppm: ", err.Error())
|
fmt.Println("Error during pdftoppm: ", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if name == "" || description == "" {
|
if name == "" || description == "" {
|
||||||
@@ -154,6 +156,8 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop
|
|||||||
PrintMode: printMode,
|
PrintMode: printMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("Creating Shopitem: ", shopItem)
|
||||||
|
|
||||||
for _, tagId := range tagIds {
|
for _, tagId := range tagIds {
|
||||||
tag, err := repositories.Tags.GetById(tagId)
|
tag, err := repositories.Tags.GetById(tagId)
|
||||||
|
|
||||||
@@ -447,10 +451,13 @@ func (rc *shopItemController) EditItemHandler(c *gin.Context) {
|
|||||||
newShopItem.Name = shopItem.Name
|
newShopItem.Name = shopItem.Name
|
||||||
newShopItem.Abstract = shopItem.Abstract
|
newShopItem.Abstract = shopItem.Abstract
|
||||||
newShopItem.Description = shopItem.Description
|
newShopItem.Description = shopItem.Description
|
||||||
|
newShopItem.Category = shopItem.Category
|
||||||
|
newShopItem.Variants = shopItem.Variants
|
||||||
newShopItem.BasePrice = shopItem.BasePrice
|
newShopItem.BasePrice = shopItem.BasePrice
|
||||||
newShopItem.IsPublic = shopItem.IsPublic
|
newShopItem.IsPublic = shopItem.IsPublic
|
||||||
newShopItem.Tags = shopItem.Tags
|
newShopItem.Tags = shopItem.Tags
|
||||||
newShopItem.Variants = shopItem.Variants
|
newShopItem.Image = shopItem.Image
|
||||||
|
newShopItem.Pdf = shopItem.Pdf
|
||||||
newShopItem.PrintMode = shopItem.PrintMode
|
newShopItem.PrintMode = shopItem.PrintMode
|
||||||
|
|
||||||
tags, err := repositories.Tags.GetAll()
|
tags, err := repositories.Tags.GetAll()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
|
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
|
||||||
<form class="space-y-6" action="#" method="POST">
|
<form class="space-y-6" action="#" method="POST" enctype="multipart/form-data">
|
||||||
<div>
|
<div>
|
||||||
<label for="name" class="block text-sm/6 font-medium text-gray-900">Name</label>
|
<label for="name" class="block text-sm/6 font-medium text-gray-900">Name</label>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user