aboutsummaryrefslogtreecommitdiff
path: root/src/server/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Controller')
-rw-r--r--src/server/Controller/Payment.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/Controller/Payment.hs b/src/server/Controller/Payment.hs
index 1287825..219206a 100644
--- a/src/server/Controller/Payment.hs
+++ b/src/server/Controller/Payment.hs
@@ -11,10 +11,13 @@ import Control.Monad.IO.Class (liftIO)
import Data.Text (Text)
+import Database.Persist.Sqlite (unSqlBackendKey)
+
import qualified Secure
import Model.Database
import Model.Payment
+import Model.Json.Message
getPaymentsAction :: ActionM ()
getPaymentsAction =
@@ -26,6 +29,6 @@ getPaymentsAction =
createPaymentAction :: Text -> Int -> ActionM ()
createPaymentAction name cost =
Secure.loggedAction (\user -> do
- _ <- liftIO . runDb $ createPayment (entityKey user) name cost
- return ()
+ paymentKey <- liftIO . runDb $ createPayment (entityKey user) name cost
+ json . Message . paymentKeyToText $ paymentKey
)