This commit is contained in:
nek0 2017-08-04 07:04:29 +02:00
parent 752fafae15
commit a6a30a7705
4 changed files with 9 additions and 4 deletions

View File

@ -47,12 +47,14 @@ postTransferR from to =
((res, _), _) <- runFormPost
$ renderBootstrap3 BootstrapBasicForm transferForm
case res of
FormSuccess amount -> do
if amount < 0
then do
FormSuccess amount
| amount < 0 -> do
setMessageI MsgNegativeTransfer
redirect $ TransferR from to
else do
| userBalance sender < amount -> do
setMessageI MsgNotEnoughFunds
redirect HomeR
| otherwise -> do
runDB $ update from [UserBalance -=. amount]
runDB $ update to [UserBalance +=. amount]
master <- getYesod

View File

@ -146,3 +146,4 @@ UserIdentNotUnique: Uživatelské jméno není jedinečný
Login: Přihlásit
Logout: Odhlásit
CreationBlocked: Nelze vytvořit nové uživatele.
NotEnoughFunds: Nedostatek kreditu

View File

@ -146,3 +146,4 @@ UserIdentNotUnique: Benutzername ist nicht einzigartig
Login: Login
Logout: Logout
CreationBlocked: Es können keine neuen Nutzer angelegt werden.
NotEnoughFunds: Nicht genügen Guthaben

View File

@ -146,3 +146,4 @@ UserIdentNotUnique: Username is not unique
Login: Login
Logout: Logout
CreationBlocked: New users can not be created.
NotEnoughFunds: Not enough funds!