commence prouct pages
This commit is contained in:
parent
5b1b4b8cfe
commit
8b0dadb645
1 changed files with 13 additions and 7 deletions
|
@ -55,14 +55,20 @@ productStockUpdate
|
||||||
:: Maybe (Int, AuthMethod)
|
:: Maybe (Int, AuthMethod)
|
||||||
-> [AmountUpdate]
|
-> [AmountUpdate]
|
||||||
-> MateHandler ()
|
-> MateHandler ()
|
||||||
productStockUpdate (Just _) amoups =
|
productStockUpdate (Just (_, method)) amoups =
|
||||||
if all ((>= 0) . amountUpdateRealAmount) amoups
|
if method `elem` [PrimaryPass, ChallengeResponse]
|
||||||
then do
|
then
|
||||||
conn <- asks rsConnection
|
if all ((>= 0) . amountUpdateRealAmount) amoups
|
||||||
void $ manualProductAmountUpdate amoups conn
|
then do
|
||||||
|
conn <- asks rsConnection
|
||||||
|
void $ manualProductAmountUpdate amoups conn
|
||||||
|
else
|
||||||
|
throwError $ err400
|
||||||
|
{ errBody = "Amounts less than 0 are not acceptable."
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throwError $ err400
|
throwError $ err401
|
||||||
{ errBody = "Amounts less than 0 are not acceptable."
|
{ errBody = "Wrong Authentication present."
|
||||||
}
|
}
|
||||||
productStockUpdate Nothing _ =
|
productStockUpdate Nothing _ =
|
||||||
throwError $ err401
|
throwError $ err401
|
||||||
|
|
Loading…
Reference in a new issue