diff options
author | Joris Guyonvarch | 2015-08-13 22:55:41 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-13 22:55:41 +0200 |
commit | 359f837511597354bc6462cfc4200f54d647d728 (patch) | |
tree | 13d896bd1280a735945609e890faa606abd135fa /src/server/Controller | |
parent | 35557ae09d10aa6388b79e2e19ee7702efb28bc6 (diff) |
Giving the payment id to the client
Diffstat (limited to 'src/server/Controller')
-rw-r--r-- | src/server/Controller/Payment.hs | 7 |
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 ) |