aboutsummaryrefslogtreecommitdiff
path: root/src/client/Update
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Update')
-rw-r--r--src/client/Update/Payment.elm26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/client/Update/Payment.elm b/src/client/Update/Payment.elm
index 1b43f6f..f063b4c 100644
--- a/src/client/Update/Payment.elm
+++ b/src/client/Update/Payment.elm
@@ -10,7 +10,7 @@ import Model exposing (Model)
import Model.User exposing (UserId)
import Model.Payment exposing (..)
import Model.Payers exposing (..)
-import Model.View.PaymentView exposing (..)
+import Model.View.LoggedView exposing (..)
import Model.View.Payment.Add exposing (..)
import Update.Payment.Add exposing (..)
@@ -23,31 +23,31 @@ type PaymentAction =
| Remove UserId Int Payments
| UpdatePage Int Payments
-updatePayment : Model -> PaymentAction -> PaymentView -> PaymentView
-updatePayment model action paymentView =
+updatePayment : Model -> PaymentAction -> LoggedView -> LoggedView
+updatePayment model action loggedView =
case action of
UpdateAdd addPaymentAction ->
- { paymentView | add <- updateAddPayment addPaymentAction paymentView.add }
+ { loggedView | add <- updateAddPayment addPaymentAction loggedView.add }
UpdatePayments payments ->
- { paymentView | payments <- payments }
+ { loggedView | payments <- payments }
AddPayment userId cost payments ->
- { paymentView
+ { loggedView
| payments <- payments
, currentPage <- 1
, add <- initAddPayment
- , payers <- updatePayers paymentView.payers userId cost
- , paymentsCount <- paymentView.paymentsCount + 1
+ , payers <- updatePayers loggedView.payers userId cost
+ , paymentsCount <- loggedView.paymentsCount + 1
}
ToggleEdit id ->
- { paymentView | edition <- if paymentView.edition == Just id then Nothing else Just id }
+ { loggedView | edition <- if loggedView.edition == Just id then Nothing else Just id }
Remove userId cost payments ->
- { paymentView
+ { loggedView
| payments <- payments
- , payers <- updatePayers paymentView.payers userId -cost
- , paymentsCount <- paymentView.paymentsCount - 1
+ , payers <- updatePayers loggedView.payers userId -cost
+ , paymentsCount <- loggedView.paymentsCount - 1
}
UpdatePage page payments ->
- { paymentView
+ { loggedView
| currentPage <- page
, payments <- payments
}