Tested eve-api
This commit is contained in:
@ -2,13 +2,23 @@ module Handler.Wallet where
|
||||
|
||||
import Import
|
||||
|
||||
import Eve.Api.Char
|
||||
import Eve.Api.Types as T
|
||||
|
||||
getWalletR :: Handler Html
|
||||
getWalletR = do
|
||||
getWalletR = loginOrDo $ (\(uid,user) -> do
|
||||
man <- getHttpManager <$> ask
|
||||
apiKey <- runDB $ getBy $ UniqueApiUser uid
|
||||
acc <- case apiKey of
|
||||
Just (Entity _ (Api _ k v)) -> do
|
||||
a <- liftIO $ getAccountBalance man (ApiComplete (T.ApiKey (VCode v) (KeyId k)) (T.CharacterId (userCharId user)))
|
||||
return (Just a)
|
||||
Nothing -> return Nothing
|
||||
defaultLayout $ [whamlet|
|
||||
<h1>Transactions in the last xx hours
|
||||
|
||||
<h1>Statistices for the last xx days
|
||||
|
||||
|]
|
||||
|
||||
#{show acc}
|
||||
|]
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user