neat/Handler/Wallet.hs

25 lines
733 B
Haskell
Raw Normal View History

2015-04-26 20:18:24 +00:00
module Handler.Wallet where
import Import
2015-07-24 19:12:18 +00:00
import Eve.Api.Char
import Eve.Api.Types as T
2015-04-26 20:18:24 +00:00
getWalletR :: Handler Html
2015-07-24 19:12:18 +00:00
getWalletR = loginOrDo $ (\(uid,user) -> do
man <- getHttpManager <$> ask
apiKey <- runDB $ getBy $ UniqueApiUser uid
acc <- case apiKey of
Just (Entity _ (Api _ k v)) -> do
2015-08-03 10:52:48 +00:00
a <- liftIO $ getStandings man (mkComplete k v (userCharId user))
2015-07-24 19:12:18 +00:00
return (Just a)
Nothing -> return Nothing
defaultLayout $ [whamlet|
<h1>Transactions in the last xx hours
<h1>Statistices for the last xx days
2015-07-24 19:12:18 +00:00
#{show acc}
|]
)