aboutsummaryrefslogtreecommitdiff
path: root/server/src/Controller/Income.hs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Controller/Income.hs')
-rw-r--r--server/src/Controller/Income.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/Controller/Income.hs b/server/src/Controller/Income.hs
index 19f0cfc..3f623e5 100644
--- a/server/src/Controller/Income.hs
+++ b/server/src/Controller/Income.hs
@@ -14,20 +14,20 @@ import Common.Model (CreateIncome (..), EditIncome (..),
import qualified Common.Msg as Msg
import Json (jsonId)
-import qualified Model.Income as Income
import qualified Model.Query as Query
+import qualified Persistence.Income as IncomePersistence
import qualified Secure
create :: CreateIncome -> ActionM ()
create (CreateIncome date amount) =
Secure.loggedAction (\user ->
- (liftIO . Query.run $ Income.create (_user_id user) date amount) >>= jsonId
+ (liftIO . Query.run $ IncomePersistence.create (_user_id user) date amount) >>= jsonId
)
editOwn :: EditIncome -> ActionM ()
editOwn (EditIncome incomeId date amount) =
Secure.loggedAction (\user -> do
- updated <- liftIO . Query.run $ Income.editOwn (_user_id user) incomeId date amount
+ updated <- liftIO . Query.run $ IncomePersistence.editOwn (_user_id user) incomeId date amount
if updated
then status ok200
else status badRequest400
@@ -36,7 +36,7 @@ editOwn (EditIncome incomeId date amount) =
deleteOwn :: IncomeId -> ActionM ()
deleteOwn incomeId =
Secure.loggedAction (\user -> do
- deleted <- liftIO . Query.run $ Income.deleteOwn user incomeId
+ deleted <- liftIO . Query.run $ IncomePersistence.deleteOwn user incomeId
if deleted
then
status ok200