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 | |
parent | d22d10da342520163014dda255d5d9bd5e1a80c0 (diff) |
Validate add payment server side
Diffstat (limited to 'src/client/elm/View')
-rw-r--r-- | src/client/elm/View/LoggedIn/AddPayment.elm | 10 | ||||
-rw-r--r-- | src/client/elm/View/LoggedIn/Paging.elm | 4 |
2 files changed, 5 insertions, 9 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" ] diff --git a/src/client/elm/View/LoggedIn/Paging.elm b/src/client/elm/View/LoggedIn/Paging.elm index 154686a..b722ee7 100644 --- a/src/client/elm/View/LoggedIn/Paging.elm +++ b/src/client/elm/View/LoggedIn/Paging.elm @@ -8,7 +8,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) -import Model.Action exposing (..) +import Model.Action as Action exposing (..) import Model.Action.LoggedInAction exposing (..) import Model.View.LoggedInView exposing (..) import Model.Payment exposing (perPage) @@ -94,6 +94,6 @@ paymentsPage address loggedInView page = , ("current", onCurrentPage) ] , onClick address <| - if onCurrentPage then NoOp else UpdateLoggedIn (UpdatePage page) + if onCurrentPage then Action.NoOp else UpdateLoggedIn (UpdatePage page) ] [ text (toString page) ] |