aboutsummaryrefslogtreecommitdiff
path: root/src/server/Application.hs
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-07-18 18:29:46 +0200
committerJoris Guyonvarch2015-07-18 18:29:46 +0200
commit3486644b442a0800f645ec9ae7f3ce8fe2b3c9cd (patch)
tree07cf31c37b09a2cb8bcb04380b91a640727888df /src/server/Application.hs
parentb27a7914993f5a5a87160dc33431a6fa1f4ad323 (diff)
downloadbudget-3486644b442a0800f645ec9ae7f3ce8fe2b3c9cd.tar.gz
budget-3486644b442a0800f645ec9ae7f3ce8fe2b3c9cd.tar.bz2
budget-3486644b442a0800f645ec9ae7f3ce8fe2b3c9cd.zip
Showing either the payment table or a forbidden message in the UI
Diffstat (limited to 'src/server/Application.hs')
-rw-r--r--src/server/Application.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server/Application.hs b/src/server/Application.hs
index b83273f..e480533 100644
--- a/src/server/Application.hs
+++ b/src/server/Application.hs
@@ -37,10 +37,7 @@ import Model.Payment
import View.Page (page)
getIndexAction :: ActionM ()
-getIndexAction =
- Secure.loggedAction (\_ ->
- html $ page
- )
+getIndexAction = html page
getUsersAction :: ActionM ()
getUsersAction = do
@@ -48,9 +45,11 @@ getUsersAction = do
html . fromString . show $ users
getPaymentsAction :: ActionM ()
-getPaymentsAction = do
- payments <- liftIO $ runDb getPayments
- json payments
+getPaymentsAction =
+ Secure.loggedAction (\_ -> do
+ payments <- liftIO $ runDb getPayments
+ json payments
+ )
addUserAction :: Text -> Text -> ActionM ()
addUserAction email name = do