diff options
Diffstat (limited to 'src/server/Controller/Payment.hs')
-rw-r--r-- | src/server/Controller/Payment.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/Controller/Payment.hs b/src/server/Controller/Payment.hs index cbd342a..117310a 100644 --- a/src/server/Controller/Payment.hs +++ b/src/server/Controller/Payment.hs @@ -2,6 +2,7 @@ module Controller.Payment ( getPaymentsAction , createPaymentAction , deletePaymentAction + , getTotalPaymentsAction ) where import Web.Scotty @@ -47,3 +48,9 @@ deletePaymentAction paymentId = status badRequest400 json . Message . getMessage $ PaymentNotDeleted ) + +getTotalPaymentsAction :: ActionM () +getTotalPaymentsAction = + Secure.loggedAction (\_ -> do + (liftIO . runDb $ getTotalPayments) >>= json + ) |