diff options
Diffstat (limited to 'src/client/Update/Payment.elm')
-rw-r--r-- | src/client/Update/Payment.elm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/client/Update/Payment.elm b/src/client/Update/Payment.elm index 136f0f9..2d558fd 100644 --- a/src/client/Update/Payment.elm +++ b/src/client/Update/Payment.elm @@ -6,22 +6,22 @@ module Update.Payment import Date import Model exposing (Model) -import Model.View.PaymentView exposing (..) import Model.Payment exposing (..) +import Model.View.PaymentView exposing (..) +import Model.View.Payment.Add exposing (..) + +import Update.Payment.Add exposing (..) type PaymentAction = - UpdateName String - | UpdateCost String + UpdateAdd AddPaymentAction | UpdatePayments Payments | AddPayment String Int updatePayment : Model -> PaymentAction -> PaymentView -> PaymentView updatePayment model action paymentView = case action of - UpdateName name -> - { paymentView | name <- name } - UpdateCost cost -> - { paymentView | cost <- cost } + UpdateAdd addPaymentAction -> + { paymentView | add <- updateAddPayment addPaymentAction paymentView.add } UpdatePayments payments -> { paymentView | payments <- payments } AddPayment name cost -> @@ -33,6 +33,5 @@ updatePayment model action paymentView = } in { paymentView | payments <- payment :: paymentView.payments - , name <- "" - , cost <- "" + , add <- initAddPayment } |