aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Income
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/View/Income')
-rw-r--r--client/src/View/Income/Income.hs19
1 files changed, 6 insertions, 13 deletions
diff --git a/client/src/View/Income/Income.hs b/client/src/View/Income/Income.hs
index 91682a0..18ebe7c 100644
--- a/client/src/View/Income/Income.hs
+++ b/client/src/View/Income/Income.hs
@@ -4,14 +4,15 @@ module View.Income.Income
, IncomeIn(..)
) where
+import Data.Aeson (FromJSON)
import Prelude hiding (init)
import Reflex.Dom (Dynamic, MonadWidget)
import qualified Reflex.Dom as R
import Common.Model (Currency)
-import Model.Loadable (Loadable (..))
-import qualified Model.Loadable as Loadable
+import Loadable (Loadable (..))
+import qualified Loadable
import qualified Util.Ajax as AjaxUtil
import View.Income.Header (HeaderIn (..), HeaderOut (..))
import qualified View.Income.Header as Header
@@ -26,17 +27,9 @@ data IncomeIn t = IncomeIn
init :: forall t m. MonadWidget t m => m (Dynamic t (Loadable Init))
init = do
- postBuild <- R.getPostBuild
-
- usersEvent <- AjaxUtil.get (R.tag (R.constant "api/users") postBuild)
- users <- Loadable.fromEvent usersEvent
-
- incomesEvent <- AjaxUtil.get (R.tag (R.constant "api/incomes") postBuild)
- incomes <- Loadable.fromEvent incomesEvent
-
- paymentsEvent <- AjaxUtil.get (R.tag (R.constant "api/payments") postBuild)
- payments <- Loadable.fromEvent paymentsEvent
-
+ users <- AjaxUtil.getNow "api/users"
+ incomes <- AjaxUtil.getNow "api/incomes"
+ payments <- AjaxUtil.getNow "api/payments"
return $ do
us <- users
is <- incomes