aboutsummaryrefslogtreecommitdiff
path: root/src/server/Main.hs
diff options
context:
space:
mode:
authorJoris2015-09-06 00:05:50 +0200
committerJoris2015-09-06 00:05:50 +0200
commit24633871359ec9fbd63fdfebf79a6351b2792f77 (patch)
treea87c8a964a3c5114da13e622c604cf99ab905a06 /src/server/Main.hs
parent8c328987901973cd0ffd2e03cae547717ebbbc67 (diff)
downloadbudget-24633871359ec9fbd63fdfebf79a6351b2792f77.tar.gz
budget-24633871359ec9fbd63fdfebf79a6351b2792f77.tar.bz2
budget-24633871359ec9fbd63fdfebf79a6351b2792f77.zip
Can add monthly payments, not visible at the moment though, just the count is printed
Diffstat (limited to 'src/server/Main.hs')
-rw-r--r--src/server/Main.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/Main.hs b/src/server/Main.hs
index 27908b4..c3d285e 100644
--- a/src/server/Main.hs
+++ b/src/server/Main.hs
@@ -13,6 +13,7 @@ import Controller.Payment
import Controller.User
import Model.Database (runMigrations)
+import Model.Frequency
import Config
@@ -54,10 +55,14 @@ main = do
perPage <- param "perPage" :: ActionM Int
getPaymentsAction page perPage
+ get "/monthlyPayments" $ do
+ getMonthlyPaymentsAction
+
post "/payment/add" $ do
name <- param "name" :: ActionM Text
cost <- param "cost" :: ActionM Int
- createPaymentAction name cost
+ frequency <- param "frequency" :: ActionM Frequency
+ createPaymentAction name cost frequency
post "/payment/delete" $ do
paymentId <- param "id" :: ActionM Text