aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Payment/Header.hs
diff options
context:
space:
mode:
authorJoris2019-08-05 21:53:30 +0200
committerJoris2019-08-05 21:53:30 +0200
commitbc81084933f8ec1bfe6c2834defd12243117fdd9 (patch)
tree116d5e8ccd5f234d7376f4f14c74657d7c7e4792 /client/src/View/Payment/Header.hs
parent2741f47ef7b87255203bc2f7f7b2b9140c70b8f0 (diff)
downloadbudget-bc81084933f8ec1bfe6c2834defd12243117fdd9.tar.gz
budget-bc81084933f8ec1bfe6c2834defd12243117fdd9.tar.bz2
budget-bc81084933f8ec1bfe6c2834defd12243117fdd9.zip
Use updated payment categories from payment add in payment’s table
Diffstat (limited to 'client/src/View/Payment/Header.hs')
-rw-r--r--client/src/View/Payment/Header.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/client/src/View/Payment/Header.hs b/client/src/View/Payment/Header.hs
index 56441eb..c49b284 100644
--- a/client/src/View/Payment/Header.hs
+++ b/client/src/View/Payment/Header.hs
@@ -17,10 +17,10 @@ import Prelude hiding (init)
import Reflex.Dom (Dynamic, Event, MonadWidget, Reflex)
import qualified Reflex.Dom as R
-import Common.Model (Category, Currency,
- ExceedingPayer (..), Frequency (..),
- Income (..), Init (..), Payment (..),
- User (..))
+import Common.Model (Category, CreatedPayment (..),
+ Currency, ExceedingPayer (..),
+ Frequency (..), Income (..), Init (..),
+ Payment (..), User (..))
import qualified Common.Model as CM
import qualified Common.Msg as Msg
import qualified Common.View.Format as Format
@@ -41,14 +41,14 @@ data HeaderIn t = HeaderIn
data HeaderOut t = HeaderOut
{ _headerOut_searchName :: Dynamic t Text
, _headerOut_searchFrequency :: Dynamic t Frequency
- , _headerOut_addedPayment :: Event t Payment
+ , _headerOut_addPayment :: Event t CreatedPayment
}
widget :: forall t m. MonadWidget t m => HeaderIn t -> m (HeaderOut t)
widget headerIn =
R.divClass "header" $ do
- addedPayment <- payerAndAdd incomes punctualPayments users categories currency
- let resetSearchName = fmap (const ()) $ addedPayment
+ addPayment <- payerAndAdd incomes punctualPayments users categories currency
+ let resetSearchName = fmap (const ()) $ addPayment
(searchName, searchFrequency) <- searchLine resetSearchName
infos (_headerIn_searchPayments headerIn) users currency
@@ -56,7 +56,7 @@ widget headerIn =
return $ HeaderOut
{ _headerOut_searchName = searchName
, _headerOut_searchFrequency = searchFrequency
- , _headerOut_addedPayment = addedPayment
+ , _headerOut_addPayment = addPayment
}
where
init = _headerIn_init headerIn
@@ -74,7 +74,7 @@ payerAndAdd
-> [User]
-> [Category]
-> Currency
- -> m (Event t Payment)
+ -> m (Event t CreatedPayment)
payerAndAdd incomes payments users categories currency = do
time <- liftIO Time.getCurrentTime
R.divClass "payerAndAdd" $ do
@@ -101,7 +101,7 @@ payerAndAdd incomes payments users categories currency = do
{ _modalIn_show = addPaymentClic
, _modalIn_hide = R.leftmost $
[ _addOut_cancel addOut
- , fmap (const ()) . _addOut_addedPayment $ addOut
+ , fmap (const ()) . _addOut_addPayment $ addOut
]
, _modalIn_content = Add.view $ AddIn
{ _addIn_categories = categories
@@ -109,7 +109,7 @@ payerAndAdd incomes payments users categories currency = do
}
}
let addOut = _modalOut_content modalOut
- return (_addOut_addedPayment addOut)
+ return (_addOut_addPayment addOut)
searchLine
:: forall t m. MonadWidget t m