diff options
Diffstat (limited to 'src/server/Controller/Payment.hs')
-rw-r--r-- | src/server/Controller/Payment.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/Controller/Payment.hs b/src/server/Controller/Payment.hs index 7cbfb37..85e2a87 100644 --- a/src/server/Controller/Payment.hs +++ b/src/server/Controller/Payment.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE OverloadedStrings #-} + module Controller.Payment ( getPaymentsAction , getMonthlyPaymentsAction @@ -16,18 +18,21 @@ import Database.Persist import Control.Monad.IO.Class (liftIO) import Data.Text (Text) +import qualified Data.Aeson.Types as Json import qualified Secure import Model.Database 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)) + +import Json (jsonObject) + getPaymentsAction :: Int -> Int -> ActionM () getPaymentsAction page perPage = Secure.loggedAction (\_ -> do @@ -56,7 +61,7 @@ deletePaymentAction paymentId = status ok200 else do status badRequest400 - json . Message . getMessage $ PaymentNotDeleted + jsonObject [("error", Json.String $ getMessage PaymentNotDeleted)] ) getTotalPaymentsAction :: ActionM () |