Skip to content

Commit

Permalink
Merge pull request #49 from nikhilnarayanan623/fix/stock
Browse files Browse the repository at this point in the history
stock update query fix
  • Loading branch information
nikhilnarayanan623 authored Jul 11, 2023
2 parents d5c7ed5 + edea62c commit 99d3b32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/repository/stock.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewStockRepository(db *gorm.DB) interfaces.StockRepository {

func (c *stockDatabase) Update(ctx context.Context, valuesToUpdate request.UpdateStock) error {

query := `UPDpATE product_items SET qty_in_stock = qty_in_stock + $1 WHERE sku = $2`
query := `UPDATE product_items SET qty_in_stock = qty_in_stock + $1 WHERE sku = $2`

err := c.DB.Exec(query, valuesToUpdate.QtyToAdd, valuesToUpdate.SKU).Error

Expand Down

0 comments on commit 99d3b32

Please sign in to comment.