From 7ac3d8c87f81ac70c312785b47857d0e1f65545d Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 10 May 2020 10:06:10 +0200 Subject: [PATCH] linting --- src/Control/User.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Control/User.hs b/src/Control/User.hs index 9f78728..b6c42e3 100644 --- a/src/Control/User.hs +++ b/src/Control/User.hs @@ -84,7 +84,7 @@ userRecharge -> UserRecharge -> MateHandler () userRecharge (Just (auid, _)) (UserRecharge amount) = do - when (amount < 0) $ do + when (amount < 0) $ throwError $ err400 { errBody = "Amounts less or equal zero are not acceptable." } @@ -108,26 +108,26 @@ userTransfer -> UserTransfer -> MateHandler () userTransfer (Just (auid, method)) (UserTransfer target amount) = do - when (amount < 0) $ do + when (amount < 0) $ throwError $ err400 { errBody = "Amounts less or equal zero are not acceptable." } - when (auid == target) $ do + when (auid == target) $ throwError $ err400 { errBody = "You can not transfer yourself money." } - when (method `notElem` [PrimaryPass, ChallengeResponse]) $ do + when (method `notElem` [PrimaryPass, ChallengeResponse]) $ throwError $ err401 { errBody = "No Authentication present." } conn <- asks rsConnection user <- userDetailsSelect auid conn - when (amount > userDetailsBalance user) $ do + when (amount > userDetailsBalance user) $ throwError $ err400 { errBody = "Not enough credit balance." } mtarget <- filter (\u -> userSummaryId u == target) <$> userSelect AllUsers conn - when (null mtarget) $ do + when (null mtarget) $ throwError $ err400 { errBody = "Target user not found." }