Derped the parameters
This commit is contained in:
parent
9d42213ec6
commit
5cc8b76dba
@ -158,8 +158,7 @@ let decrementItemStock (item : Item) = async {
|
|||||||
let incrementItemStock (amount : int<GBT>) symbol =
|
let incrementItemStock (amount : int<GBT>) symbol =
|
||||||
connStr
|
connStr
|
||||||
|> Sql.connect
|
|> Sql.connect
|
||||||
|> Sql.parameters [ ( "iid" , Sql.string symbol) ]
|
|> Sql.parameters [ ( "iid" , Sql.string symbol) ; ( "amount" , Sql.int (int amount)) ]
|
||||||
|> Sql.parameters [ ( "amount" , Sql.int (int amount)) ]
|
|
||||||
|> Sql.query """
|
|> Sql.query """
|
||||||
UPDATE store_item SET stock = stock + @amount
|
UPDATE store_item SET stock = stock + @amount
|
||||||
WHERE store_item.item_id = @iid
|
WHERE store_item.item_id = @iid
|
||||||
@ -172,8 +171,7 @@ let setItemStock (amount : int<GBT>) symbol = async {
|
|||||||
try
|
try
|
||||||
do! connStr
|
do! connStr
|
||||||
|> Sql.connect
|
|> Sql.connect
|
||||||
|> Sql.parameters [ ( "amount" , Sql.int (int amount) ) ]
|
|> Sql.parameters [ ( "amount" , Sql.int (int amount) ) ; ( "iid" , Sql.string symbol ) ]
|
||||||
|> Sql.parameters [ ( "iid" , Sql.string symbol ) ]
|
|
||||||
|> Sql.query """
|
|> Sql.query """
|
||||||
UPDATE store_item SET stock = @amount
|
UPDATE store_item SET stock = @amount
|
||||||
WHERE store_item.item_id = (SELECT id FROM item WHERE id = @iid)
|
WHERE store_item.item_id = (SELECT id FROM item WHERE id = @iid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user