From 2d79ab0e0a11f55255fc21a5dfab1598d3beeba3 Mon Sep 17 00:00:00 2001
From: Joris
Date: Sun, 11 Aug 2019 22:40:09 +0200
Subject: Add payment clone

---
 client/src/View/Payment.hs | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'client/src/View/Payment.hs')

diff --git a/client/src/View/Payment.hs b/client/src/View/Payment.hs
index f363b06..ab83447 100644
--- a/client/src/View/Payment.hs
+++ b/client/src/View/Payment.hs
@@ -11,9 +11,9 @@ import           Prelude             hiding (init)
 import           Reflex.Dom          (Dynamic, Event, MonadWidget, Reflex)
 import qualified Reflex.Dom          as R
 
-import           Common.Model        (CreatedPayment (..), Frequency, Init (..),
-                                      Payment (..), PaymentCategory (..),
-                                      PaymentId)
+import           Common.Model        (Frequency, Init (..), Payment (..),
+                                      PaymentCategory (..), PaymentId,
+                                      SavedPayment (..))
 import qualified Common.Util.Text    as T
 import           View.Payment.Header (HeaderIn (..), HeaderOut (..))
 import qualified View.Payment.Header as Header
@@ -36,15 +36,19 @@ widget paymentIn = do
     rec
       let init = _paymentIn_init paymentIn
           paymentsPerPage = 7
+          savedPayments = R.leftmost
+            [ _headerOut_addPayment header
+            , _tableOut_addPayment table
+            ]
 
       payments <- getPayments
         (_init_payments init)
-        (_createdPayment_payment <$> _headerOut_addPayment header)
+        (_savedPayment_payment <$> savedPayments)
         (_tableOut_deletePayment table)
 
       paymentCategories <- getPaymentCategories
         (_init_paymentCategories init)
-        (_createdPayment_paymentCategory <$> _headerOut_addPayment header)
+        (_savedPayment_paymentCategory <$> savedPayments)
         payments
         (_tableOut_deletePayment table)
 
-- 
cgit v1.2.3