diff options
author | Joris | 2015-09-12 23:57:16 +0200 |
---|---|---|
committer | Joris | 2015-09-12 23:57:16 +0200 |
commit | a48e79e2f7c1ab1ffb52b86ef9e900c75c5d023b (patch) | |
tree | 05a613aef2d338f10bcdd394e520450656ed8f1c /src/server/Main.hs | |
parent | d87dbd1360c14df83552fd757438c23e5d7b9f9c (diff) |
Adding UI income read-only
Diffstat (limited to 'src/server/Main.hs')
-rw-r--r-- | src/server/Main.hs | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/server/Main.hs b/src/server/Main.hs index 1a151fc..8956fa4 100644 --- a/src/server/Main.hs +++ b/src/server/Main.hs @@ -33,46 +33,43 @@ main = do middleware $ staticPolicy (noDots >-> addBase "public") - get "/" $ - getIndexAction + get "/" getIndex + post "/signOut" signOut + + -- SignIn post "/signIn" $ do login <- param "login" :: ActionM Text - signInAction config login + signIn config login get "/validateSignIn" $ do token <- param "token" :: ActionM Text - validateSignInAction config token + validateSignIn config token - post "/signOut" $ - signOutAction + -- Users - get "/whoAmI" $ - whoAmIAction + get "/users" getUsers + get "/whoAmI" whoAmI + get "/income" getIncome - get "/users" $ do - getUsersAction + -- Payments get "/payments" $ do - page <- param "page" :: ActionM Int + page <- param "page" :: ActionM Int perPage <- param "perPage" :: ActionM Int - getPaymentsAction page perPage + getPayments page perPage - get "/monthlyPayments" $ do - getMonthlyPaymentsAction + get "/monthlyPayments" getMonthlyPayments post "/payment/add" $ do name <- param "name" :: ActionM Text cost <- param "cost" :: ActionM Int frequency <- param "frequency" :: ActionM Frequency - createPaymentAction name cost frequency + createPayment name cost frequency post "/payment/delete" $ do paymentId <- param "id" :: ActionM Text - deletePaymentAction paymentId - - get "/payments/total" $ do - getTotalPaymentsAction + deletePayment paymentId - get "/payments/count" $ do - getPaymentsCountAction + get "/payments/total" getTotalPayments + get "/payments/count" getPaymentsCount |