chore: update

This commit is contained in:
2026-05-19 18:42:51 +02:00
parent d773a9c49f
commit c71b596400
7 changed files with 25 additions and 25 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ func (d *Database) GetProductByID(id int) (models.Product, error) {
var p models.Product
err := d.GDB.Raw(`
SELECT id, name, category, description, stock, unit, created_at, updated_at
SELECT id, name, category, description, stock, unit, coming_soon, created_at, updated_at
FROM products
WHERE id = ?`, id).Scan(&p).Error
if err != nil {
@@ -115,7 +115,7 @@ func (d *Database) GetAllProducts() ([]models.Product, error) {
var products []models.Product
err := d.GDB.Raw(`
SELECT id, name, category, description, stock, unit, created_at, updated_at
SELECT id, name, category, description, stock, unit, coming_soon, created_at, updated_at
FROM products
ORDER BY id ASC`).Scan(&products).Error
if err != nil {
@@ -153,7 +153,7 @@ func (d *Database) GetProductsByCategory(category string) ([]models.Product, err
var products []models.Product
err := d.GDB.Raw(`
SELECT id, name, category, description, stock, unit, created_at, updated_at
SELECT id, name, category, description, stock, unit, coming_soon, created_at, updated_at
FROM products
WHERE category = ?
ORDER BY created_at DESC`, category).Scan(&products).Error