aboutsummaryrefslogtreecommitdiff
path: root/src/server/Controller
diff options
context:
space:
mode:
authorJoris2015-09-06 12:39:03 +0200
committerJoris2015-09-06 12:39:03 +0200
commite10531ba4e60c8709088798763ae3bae6608f9c9 (patch)
treef1550fab8833f0b31831ebb2e943a51eeaa41ee2 /src/server/Controller
parent24633871359ec9fbd63fdfebf79a6351b2792f77 (diff)
Show montly payments with an expandable mechanism
Diffstat (limited to 'src/server/Controller')
-rw-r--r--src/server/Controller/Payment.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/Controller/Payment.hs b/src/server/Controller/Payment.hs
index 7944ecd..25d3261 100644
--- a/src/server/Controller/Payment.hs
+++ b/src/server/Controller/Payment.hs
@@ -24,6 +24,7 @@ import Model.Payment
import Model.Frequency
import Model.Json.Message
import Model.Json.Number
+import qualified Model.Json.PaymentId as JP
import Model.Message
import Model.Message.Key (Key(PaymentNotDeleted))
@@ -42,8 +43,8 @@ getMonthlyPaymentsAction =
createPaymentAction :: Text -> Int -> Frequency -> ActionM ()
createPaymentAction name cost frequency =
Secure.loggedAction (\user -> do
- _ <- liftIO . runDb $ createPayment (entityKey user) name cost frequency
- status ok200
+ paymentId <- liftIO . runDb $ createPayment (entityKey user) name cost frequency
+ json (JP.PaymentId paymentId)
)
deletePaymentAction :: Text -> ActionM ()