foo
This commit is contained in:
parent
64547d3d16
commit
998474640c
1 changed files with 7 additions and 6 deletions
|
@ -7,9 +7,9 @@ import Control.Monad (void)
|
||||||
|
|
||||||
import Control.Monad.Reader (asks)
|
import Control.Monad.Reader (asks)
|
||||||
|
|
||||||
import Control.Monad.Extra (anyM)
|
import Control.Monad.Extra (anyM, allM)
|
||||||
|
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe, isJust)
|
||||||
|
|
||||||
-- internal imports
|
-- internal imports
|
||||||
|
|
||||||
|
@ -56,10 +56,11 @@ productStockRefill (Just (uid, auth)) amorefs = do
|
||||||
if auth `elem` [PrimaryPass, ChallengeResponse] && mayRefill
|
if auth `elem` [PrimaryPass, ChallengeResponse] && mayRefill
|
||||||
then do
|
then do
|
||||||
conn <- asks rsConnection
|
conn <- asks rsConnection
|
||||||
prods <- mapM
|
let prods = map
|
||||||
(\refill -> productSelectSingle (amountRefillProductId refill) conn)
|
(\refill -> productSelectSingle (amountRefillProductId refill) conn)
|
||||||
amorefs
|
amorefs
|
||||||
if not (any null prods)
|
allProdsExist <- allM (fmap isJust) prods
|
||||||
|
if allProdsExist
|
||||||
then
|
then
|
||||||
if
|
if
|
||||||
all
|
all
|
||||||
|
|
Loading…
Reference in a new issue