commence prouct pages

This commit is contained in:
nek0 2019-12-13 23:48:09 +01:00
parent 5b1b4b8cfe
commit 8b0dadb645

View file

@ -55,7 +55,9 @@ productStockUpdate
:: Maybe (Int, AuthMethod) :: Maybe (Int, AuthMethod)
-> [AmountUpdate] -> [AmountUpdate]
-> MateHandler () -> MateHandler ()
productStockUpdate (Just _) amoups = productStockUpdate (Just (_, method)) amoups =
if method `elem` [PrimaryPass, ChallengeResponse]
then
if all ((>= 0) . amountUpdateRealAmount) amoups if all ((>= 0) . amountUpdateRealAmount) amoups
then do then do
conn <- asks rsConnection conn <- asks rsConnection
@ -64,6 +66,10 @@ productStockUpdate (Just _) amoups =
throwError $ err400 throwError $ err400
{ errBody = "Amounts less than 0 are not acceptable." { errBody = "Amounts less than 0 are not acceptable."
} }
else
throwError $ err401
{ errBody = "Wrong Authentication present."
}
productStockUpdate Nothing _ = productStockUpdate Nothing _ =
throwError $ err401 throwError $ err401
{ errBody = "No Authentication present." { errBody = "No Authentication present."