3 Commits

Author SHA1 Message Date
684f910090 Merge pull request 'expand_get_menu' (#42) from expand_get_menu into main
Reviewed-on: #42
Reviewed-by: Marek Goc <goc_marek@ma-al.com>
2026-03-31 14:55:35 +00:00
Daniel Goc
04e2549a66 missing / in ImageLink 2026-03-31 14:30:47 +02:00
Daniel Goc
a3f01eca7c misspell fix 2026-03-31 12:27:31 +02:00
4 changed files with 6 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ type ProductDescription struct {
DeliveryOutStock string `gorm:"column:delivery_out_stock;type:varchar(255)" json:"delivery_out_stock" form:"delivery_out_stock"` DeliveryOutStock string `gorm:"column:delivery_out_stock;type:varchar(255)" json:"delivery_out_stock" form:"delivery_out_stock"`
Usage string `gorm:"column:usage;type:text" json:"usage" form:"usage"` Usage string `gorm:"column:usage;type:text" json:"usage" form:"usage"`
ExistsInDatabse bool `gorm:"-" json:"exists_in_database"` ExistsInDatabase bool `gorm:"-" json:"exists_in_database"`
} }
type ProductRow struct { type ProductRow struct {

View File

@@ -32,7 +32,7 @@ func (repo *ListRepo) ListProducts(id_lang uint, p find.Paging, filt *filters.Fi
ps.id_product AS product_id, ps.id_product AS product_id,
pl.name AS name, pl.name AS name,
pl.link_rewrite AS link_rewrite, pl.link_rewrite AS link_rewrite,
CONCAT(?, ims.id_image, '-small_default/', pl.link_rewrite, '.webp') AS image_link, CONCAT(?, '/', ims.id_image, '-small_default/', pl.link_rewrite, '.webp') AS image_link,
cl.name AS category_name, cl.name AS category_name,
p.reference AS reference, p.reference AS reference,
COALESCE(v.variants_number, 0) AS variants_number, COALESCE(v.variants_number, 0) AS variants_number,

View File

@@ -40,11 +40,11 @@ func (r *ProductDescriptionRepo) GetProductDescription(productID uint, productid
if errors.Is(err, gorm.ErrRecordNotFound) { if errors.Is(err, gorm.ErrRecordNotFound) {
// handle "not found" case only // handle "not found" case only
ProductDescription.ExistsInDatabse = false ProductDescription.ExistsInDatabase = false
} else if err != nil { } else if err != nil {
return nil, fmt.Errorf("database error: %w", err) return nil, fmt.Errorf("database error: %w", err)
} else { } else {
ProductDescription.ExistsInDatabse = true ProductDescription.ExistsInDatabase = true
} }
return &ProductDescription, nil return &ProductDescription, nil

View File

@@ -5,13 +5,13 @@ info:
http: http:
method: GET method: GET
url: http://localhost:3000/api/v1/restricted/product-translation/get-product-description?productID=51&productLangID=4 url: http://localhost:3000/api/v1/restricted/product-translation/get-product-description?productID=51&productLangID=1
params: params:
- name: productID - name: productID
value: "51" value: "51"
type: query type: query
- name: productLangID - name: productLangID
value: "4" value: "1"
type: query type: query
auth: inherit auth: inherit