Skip to content
Snippets Groups Projects
Commit 6254adc5 authored by meskio's avatar meskio :tent:
Browse files

Allow negative price for products

parent c2aee14c
No related branches found
No related tags found
No related merge requests found
...@@ -55,9 +55,7 @@ func (d *DB) UpdateProduct(code int, product *Product) (dbProduct Product, err e ...@@ -55,9 +55,7 @@ func (d *DB) UpdateProduct(code int, product *Product) (dbProduct Product, err e
if product.Name != "" { if product.Name != "" {
dbProduct.Name = product.Name dbProduct.Name = product.Name
} }
if product.Price >= 0 {
dbProduct.Price = product.Price dbProduct.Price = product.Price
}
if product.Stock >= 0 { if product.Stock >= 0 {
dbProduct.Stock = product.Stock dbProduct.Stock = product.Stock
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment