From a271d6034bc4cc631a64476d25d21c83a701fa39 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 20 Jul 2015 21:55:52 +0200 Subject: Add a payment from the UI, it needs polishing however --- src/server/Main.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/server/Main.hs') diff --git a/src/server/Main.hs b/src/server/Main.hs index 7fd42a7..d534c4e 100644 --- a/src/server/Main.hs +++ b/src/server/Main.hs @@ -29,12 +29,17 @@ main = do token <- param "token" :: ActionM Text validateSignInAction token - post "/signOut" $ - signOutAction - get "/payments" $ getPaymentsAction + post "/payment/add" $ do + name <- param "name" :: ActionM Text + cost <- param "cost" :: ActionM Int + createPaymentAction name cost + + post "/signOut" $ + signOutAction + get "/users" getUsersAction post "/user/add" $ do email <- param "email" :: ActionM Text @@ -43,8 +48,3 @@ main = do post "/user/delete" $ do email <- param "email" :: ActionM Text deleteUserAction email - post "/payment/add" $ do - email <- param "email" :: ActionM Text - name <- param "name" :: ActionM Text - cost <- param "cost" :: ActionM Int - createPaymentAction email name cost -- cgit v1.2.3