fix error messages

This commit is contained in:
nek0 2019-09-06 21:44:31 +02:00
parent 537a88638f
commit 15e05b9075
2 changed files with 13 additions and 13 deletions

View file

@ -33,12 +33,12 @@ productStockRefill (Just _) amorefs = do
conn <- rsConnection <$> ask
void $ manualProductAmountRefill amorefs conn
else
throwError $ err406
{ errBody = "Amounts less than 0 are not acceptable"
throwError $ err400
{ errBody = "Amounts less than 0 are not acceptable."
}
productStockRefill Nothing _ =
throwError $ err403
{ errBody = "No Authentication present"
{ errBody = "No Authentication present."
}
productStockUpdate :: Maybe Int -> [AmountUpdate] -> MateHandler ()
@ -48,12 +48,12 @@ productStockUpdate (Just _) amoups = do
conn <- rsConnection <$> ask
void $ manualProductAmountUpdate amoups conn
else
throwError $ err406
{ errBody = "Amounts less than 0 are not acceptable"
throwError $ err400
{ errBody = "Amounts less than 0 are not acceptable."
}
productStockUpdate Nothing _ =
throwError $ err403
{ errBody = "No Authentication present"
{ errBody = "No Authentication present."
}
productList :: MateHandler [ProductOverview]

View file

@ -30,7 +30,7 @@ userNew us = do
userGet :: Maybe Int -> Int -> MateHandler UserDetails
userGet Nothing _ =
throwError $ err403
{ errBody = "No Authentication present"
{ errBody = "No Authentication present."
}
userGet (Just aid) id =
if aid == id
@ -38,16 +38,16 @@ userGet (Just aid) id =
now <- liftIO $ getCurrentTime
conn <- rsConnection <$> ask
-- void $ liftIO $ runUpdate_ conn (updateUser id us (utctDay now))
userDetailsSelect conn id
userDetailsSelect id conn
else
throwError $ err403
{ errBody = "Wrong Authentication present"
{ errBody = "Wrong Authentication present."
}
userUpdate :: Maybe Int -> Int -> UserDetailsSubmit -> MateHandler ()
userUpdate Nothing _ _ =
throwError $ err403
{ errBody = "No Authentication present"
{ errBody = "No Authentication present."
}
userUpdate (Just aid) id uds =
if aid == id
@ -57,7 +57,7 @@ userUpdate (Just aid) id uds =
void $ updateUserDetails id uds (utctDay now) conn
else
throwError $ err403
{ errBody = "Wrong Authentication present"
{ errBody = "Wrong Authentication present."
}
userList :: Maybe Int -> Maybe Refine -> MateHandler [User]
@ -116,8 +116,8 @@ userTransfer (Just auid) (UserTransfer target amount) =
{ errBody = "You can not transfer yourself money."
}
else
throwError $ err403
{ errBody = "Wrong Authentication present"
throwError $ err400
{ errBody = "Amounts less or equal zero are not acceptable."
}
userTransfer Nothing _ =
throwError $ err403