diff options
author | Joris | 2017-03-24 09:21:04 +0000 |
---|---|---|
committer | Joris | 2017-03-24 09:21:04 +0000 |
commit | cfca18262c1ff48dcb683ddab7d03cf8e55573ff (patch) | |
tree | 8a438430cee7411259fc395d8f3898488e85d750 /src/client/elm/LoggedIn/Home/Model.elm | |
parent | 293eb8295162bf0a038f488237db9c9d1316c04d (diff) |
Features/categories
Diffstat (limited to 'src/client/elm/LoggedIn/Home/Model.elm')
-rw-r--r-- | src/client/elm/LoggedIn/Home/Model.elm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/elm/LoggedIn/Home/Model.elm b/src/client/elm/LoggedIn/Home/Model.elm index caedc29..ace1593 100644 --- a/src/client/elm/LoggedIn/Home/Model.elm +++ b/src/client/elm/LoggedIn/Home/Model.elm @@ -3,6 +3,7 @@ module LoggedIn.Home.Model exposing , Search , init , searchInitial + , validation ) import Form exposing (Form) @@ -26,14 +27,14 @@ type alias Search = init : Model init = { currentPage = 1 - , search = Form.initial (searchInitial Punctual) searchValidation + , search = Form.initial (searchInitial Punctual) validation } searchInitial : Frequency -> List (String, Field) -searchInitial frequency = [ ("frequency", Field.Radio (toString frequency)) ] +searchInitial frequency = [ ("frequency", Field.string (toString frequency)) ] -searchValidation : Validation String Search -searchValidation = - Validate.form2 Search - (Validate.get "name" (Validate.maybe Validate.string)) - (Validate.get "frequency" Payment.validateFrequency) +validation : Validation String Search +validation = + Validate.map2 Search + (Validate.field "name" (Validate.maybe Validate.string)) + (Validate.field "frequency" Payment.validateFrequency) |