diff options
author | Joris | 2016-01-03 23:37:14 +0100 |
---|---|---|
committer | Joris | 2016-01-03 23:46:19 +0100 |
commit | d9df5c3fcffe12aac239b58ccf2fd82c19c3be62 (patch) | |
tree | aee62828e85c9d30e2beb5954062942f0d5d53f4 /src/client/elm/View/LoggedIn/AddPayment.elm | |
parent | d22d10da342520163014dda255d5d9bd5e1a80c0 (diff) |
Validate add payment server side
Diffstat (limited to 'src/client/elm/View/LoggedIn/AddPayment.elm')
-rw-r--r-- | src/client/elm/View/LoggedIn/AddPayment.elm | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/client/elm/View/LoggedIn/AddPayment.elm b/src/client/elm/View/LoggedIn/AddPayment.elm index 0b39591..0149432 100644 --- a/src/client/elm/View/LoggedIn/AddPayment.elm +++ b/src/client/elm/View/LoggedIn/AddPayment.elm @@ -2,7 +2,6 @@ module View.LoggedIn.AddPayment ( addPayment ) where -import Reads exposing (readInt) import Result exposing (..) import Signal exposing (Address) @@ -31,13 +30,10 @@ addPayment address model loggedInView = H.form [ let update = if loggedInView.add.waitingServer - then Action.NoOp + then + Action.NoOp else - case (validateName loggedInView.add.name model.translations, validateCost loggedInView.add.cost model.translations) of - (Ok name, Ok cost) -> - UpdateLoggedIn <| LoggedInAction.AddPayment name cost loggedInView.add.frequency - (resName, resCost) -> - UpdateLoggedIn <| UpdateAdd <| AddError (toMaybeError resName) (toMaybeError resCost) + UpdateLoggedIn <| LoggedInAction.AddPayment loggedInView.add.name loggedInView.add.cost loggedInView.add.frequency in onSubmitPrevDefault address update , class "addPayment" ] |