diff options
author | Joris | 2015-09-05 14:14:25 +0200 |
---|---|---|
committer | Joris | 2015-09-05 14:14:25 +0200 |
commit | cc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a (patch) | |
tree | fe60948b87993908f73659c9dbd7ffd96498b7f8 /src/client/Update | |
parent | 3b738e0d4cc65f314da7389d4542ec826ba0f454 (diff) |
Renaming PaymentView to LoggedView
Diffstat (limited to 'src/client/Update')
-rw-r--r-- | src/client/Update/Payment.elm | 26 |
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 } |