diff options
author | Joris | 2017-03-24 09:21:06 +0000 |
---|---|---|
committer | Joris | 2017-03-24 09:21:06 +0000 |
commit | c0ac16a713c4e53cf6af8e72a6d5f6b8ac5d6456 (patch) | |
tree | 8a438430cee7411259fc395d8f3898488e85d750 /src/client/elm/LoggedIn/Income/Model.elm | |
parent | 293eb8295162bf0a038f488237db9c9d1316c04d (diff) | |
parent | cfca18262c1ff48dcb683ddab7d03cf8e55573ff (diff) |
Merge branch 'features/categories' into 'master'
Features/categories
See merge request !1
Diffstat (limited to 'src/client/elm/LoggedIn/Income/Model.elm')
-rw-r--r-- | src/client/elm/LoggedIn/Income/Model.elm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/elm/LoggedIn/Income/Model.elm b/src/client/elm/LoggedIn/Income/Model.elm index cf1bf57..7d852b9 100644 --- a/src/client/elm/LoggedIn/Income/Model.elm +++ b/src/client/elm/LoggedIn/Income/Model.elm @@ -3,12 +3,13 @@ module LoggedIn.Income.Model exposing , AddIncome , init , initForm + , validation ) import Date exposing (Date) import Form exposing (Form) -import Form.Validate as Validate exposing (..) +import Form.Validate as Validate exposing (Validation) import Validation type alias Model = @@ -26,10 +27,10 @@ init = } initForm : Form String AddIncome -initForm = Form.initial [] validate +initForm = Form.initial [] validation -validate : Validation String AddIncome -validate = - form2 AddIncome - (get "amount" (int `andThen` (minInt 1))) - (get "date" Validation.date) +validation : Validation String AddIncome +validation = + Validate.map2 AddIncome + (Validate.field "amount" (Validate.int |> Validate.andThen (Validate.minInt 1))) + (Validate.field "date" Validation.date) |