diff options
Diffstat (limited to 'src/client/elm/LoggedIn/Home/Model.elm')
-rw-r--r-- | src/client/elm/LoggedIn/Home/Model.elm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/client/elm/LoggedIn/Home/Model.elm b/src/client/elm/LoggedIn/Home/Model.elm index 0a2b305..a653995 100644 --- a/src/client/elm/LoggedIn/Home/Model.elm +++ b/src/client/elm/LoggedIn/Home/Model.elm @@ -3,6 +3,9 @@ module LoggedIn.Home.Model exposing , init ) +import Form exposing (Form) +import Form.Validate as Validate exposing (Validation) + import Model.User exposing (Users, UserId) import Model.Payment exposing (PaymentId, Payments, Frequency(..)) import Model.Payer exposing (Payers) @@ -14,7 +17,11 @@ type alias Model = , paymentEdition : Maybe PaymentId , currentPage : Int , monthlyDetail : Bool - , search : String + , search : Form String Search + } + +type alias Search = + { searchText : Maybe String } init : Model @@ -23,5 +30,10 @@ init = , paymentEdition = Nothing , currentPage = 1 , monthlyDetail = False - , search = "" + , search = Form.initial [] validate } + +validate : Validation String Search +validate = + Validate.form1 Search + (Validate.get "searchText" (Validate.maybe Validate.string)) |