Fix SQL query parameter order in inventory update: Swap parameters in the execute call to correctly update inventory quantity based on the new quantity and inventory ID. Add comment for clarity on SQL operation.
This commit is contained in:
@@ -1312,7 +1312,8 @@ impl DirectorWorker {
|
||||
new_quantity: i32,
|
||||
) -> Result<(), DbError> {
|
||||
conn.prepare("update_inventory_qty", QUERY_UPDATE_INVENTORY_QTY)?;
|
||||
conn.execute("update_inventory_qty", &[&inventory_id, &new_quantity])?;
|
||||
// SQL: UPDATE inventory SET quantity = $1 WHERE id = $2
|
||||
conn.execute("update_inventory_qty", &[&new_quantity, &inventory_id])?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user