From cc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 5 Sep 2015 14:14:25 +0200 Subject: Renaming PaymentView to LoggedView --- src/client/Update/Payment.elm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/client/Update') 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 } -- cgit v1.2.3