diff options
Diffstat (limited to 'src/client/View/Payments/Add.elm')
-rw-r--r-- | src/client/View/Payments/Add.elm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm index 21406b2..deffb95 100644 --- a/src/client/View/Payments/Add.elm +++ b/src/client/View/Payments/Add.elm @@ -31,7 +31,11 @@ addPayment model loggedView = [ class "add" , case (validateName loggedView.add.name model.translations, validateCost loggedView.add.cost model.translations) of (Ok name, Ok cost) -> - onSubmitPrevDefault serverCommunications.address (SC.AddPayment loggedView.me name cost loggedView.add.frequency) + let action = + case loggedView.add.frequency of + Punctual -> SC.AddPayment loggedView.me name cost + Monthly -> SC.AddMonthlyPayment name cost + in onSubmitPrevDefault serverCommunications.address action (resName, resCost) -> onSubmitPrevDefault actions.address (UpdateLoggedView <| UpdateAdd <| AddError (toMaybeError resName) (toMaybeError resCost)) ] |