diff options
author | Joris | 2016-06-26 12:31:24 +0200 |
---|---|---|
committer | Joris | 2016-06-26 12:31:24 +0200 |
commit | 9ec84e3a20c767f6525639f58cd22715e302b88d (patch) | |
tree | a080552859180707472c1a289080857c0a54fc06 /src/server/Controller/Income.hs | |
parent | 5cb36652ccf07c9e0995ebc421a837ad7d258469 (diff) |
Add an editable date field for punctual payment creation
Diffstat (limited to 'src/server/Controller/Income.hs')
-rw-r--r-- | src/server/Controller/Income.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/Controller/Income.hs b/src/server/Controller/Income.hs index 70e40ce..fa575c5 100644 --- a/src/server/Controller/Income.hs +++ b/src/server/Controller/Income.hs @@ -2,7 +2,7 @@ module Controller.Income ( getIncomes - , addIncome + , createIncome , deleteOwnIncome ) where @@ -24,7 +24,7 @@ import Json (jsonId) import Model.Database import qualified Model.Income as Income import qualified Model.Message.Key as Key -import qualified Model.Json.AddIncome as Json +import qualified Model.Json.CreateIncome as Json getIncomes :: ActionM () getIncomes = @@ -32,10 +32,10 @@ getIncomes = (liftIO $ map Income.getJsonIncome <$> runDb Income.getIncomes) >>= json ) -addIncome :: Json.AddIncome -> ActionM () -addIncome (Json.AddIncome date amount) = +createIncome :: Json.CreateIncome -> ActionM () +createIncome (Json.CreateIncome date amount) = Secure.loggedAction (\user -> - (liftIO . runDb $ Income.addIncome (entityKey user) date amount) >>= jsonId + (liftIO . runDb $ Income.createIncome (entityKey user) date amount) >>= jsonId ) deleteOwnIncome :: Text -> ActionM () |