From 8cd63a64abafe21378c35c2489d49f24c9ece3c9 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 4 Apr 2016 01:27:36 +0200 Subject: Add income list CRUD in user page --- src/server/Controller/Payment.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/Controller/Payment.hs') diff --git a/src/server/Controller/Payment.hs b/src/server/Controller/Payment.hs index 204794a..7e8d0a3 100644 --- a/src/server/Controller/Payment.hs +++ b/src/server/Controller/Payment.hs @@ -3,7 +3,7 @@ module Controller.Payment ( getPayments , createPayment - , deletePayment + , deleteOwnPayment ) where import Web.Scotty @@ -46,8 +46,8 @@ createPayment name cost frequency = jsonObject [("id", Json.Number . fromIntegral . keyToInt64 $ paymentId)] ) -deletePayment :: Text -> ActionM () -deletePayment paymentId = +deleteOwnPayment :: Text -> ActionM () +deleteOwnPayment paymentId = Secure.loggedAction (\user -> do deleted <- liftIO . runDb $ P.deleteOwnPayment user (textToKey paymentId) if deleted -- cgit v1.2.3