From a48e79e2f7c1ab1ffb52b86ef9e900c75c5d023b Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 12 Sep 2015 23:57:16 +0200 Subject: Adding UI income read-only --- src/server/Main.hs | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/server/Main.hs') 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 -- cgit v1.2.3