From 6254adc503f631a9aa2a54c6628bad548a657218 Mon Sep 17 00:00:00 2001
From: meskio <meskio@sindominio.net>
Date: Wed, 23 Dec 2020 17:46:09 +0100
Subject: [PATCH] Allow negative price for products

---
 api/db/product.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/api/db/product.go b/api/db/product.go
index 30f183a..149c2ec 100644
--- a/api/db/product.go
+++ b/api/db/product.go
@@ -55,9 +55,7 @@ func (d *DB) UpdateProduct(code int, product *Product) (dbProduct Product, err e
 	if product.Name != "" {
 		dbProduct.Name = product.Name
 	}
-	if product.Price >= 0 {
-		dbProduct.Price = product.Price
-	}
+	dbProduct.Price = product.Price
 	if product.Stock >= 0 {
 		dbProduct.Stock = product.Stock
 	}
-- 
GitLab