diff options
author | Joris | 2015-09-05 13:53:36 +0200 |
---|---|---|
committer | Joris | 2015-09-05 13:53:36 +0200 |
commit | 3b738e0d4cc65f314da7389d4542ec826ba0f454 (patch) | |
tree | ee99236117ad698974c5a6e40ab170f617cb06f3 /src/client/Update | |
parent | 139d4a103a6a48880e5f12a796033956f223563c (diff) |
Using UserId instead of UserName to indentify users
Diffstat (limited to 'src/client/Update')
-rw-r--r-- | src/client/Update/Payment.elm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/Update/Payment.elm b/src/client/Update/Payment.elm index b9b60dd..1b43f6f 100644 --- a/src/client/Update/Payment.elm +++ b/src/client/Update/Payment.elm @@ -7,6 +7,7 @@ import Date import Dict import Model exposing (Model) +import Model.User exposing (UserId) import Model.Payment exposing (..) import Model.Payers exposing (..) import Model.View.PaymentView exposing (..) @@ -17,9 +18,9 @@ import Update.Payment.Add exposing (..) type PaymentAction = UpdateAdd AddPaymentAction | UpdatePayments Payments - | AddPayment String Int Payments + | AddPayment UserId Int Payments | ToggleEdit PaymentId - | Remove String Int Payments + | Remove UserId Int Payments | UpdatePage Int Payments updatePayment : Model -> PaymentAction -> PaymentView -> PaymentView @@ -29,20 +30,20 @@ updatePayment model action paymentView = { paymentView | add <- updateAddPayment addPaymentAction paymentView.add } UpdatePayments payments -> { paymentView | payments <- payments } - AddPayment userName cost payments -> + AddPayment userId cost payments -> { paymentView | payments <- payments , currentPage <- 1 , add <- initAddPayment - , payers <- updatePayers paymentView.payers userName cost + , payers <- updatePayers paymentView.payers userId cost , paymentsCount <- paymentView.paymentsCount + 1 } ToggleEdit id -> { paymentView | edition <- if paymentView.edition == Just id then Nothing else Just id } - Remove userName cost payments -> + Remove userId cost payments -> { paymentView | payments <- payments - , payers <- updatePayers paymentView.payers userName -cost + , payers <- updatePayers paymentView.payers userId -cost , paymentsCount <- paymentView.paymentsCount - 1 } UpdatePage page payments -> |