From 902acfbdbcc1d59941399753e887479e586e2748 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Mar 2017 23:16:28 +0200 Subject: Improve form validation - Trim names - Income amount accepted from 0 - Validate colors --- src/client/LoggedIn/Category/Model.elm | 36 ---------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 src/client/LoggedIn/Category/Model.elm (limited to 'src/client/LoggedIn/Category/Model.elm') diff --git a/src/client/LoggedIn/Category/Model.elm b/src/client/LoggedIn/Category/Model.elm deleted file mode 100644 index 7092fc4..0000000 --- a/src/client/LoggedIn/Category/Model.elm +++ /dev/null @@ -1,36 +0,0 @@ -module LoggedIn.Category.Model exposing - ( Model - , AddCategory - , init - , initForm - , validation - ) - -import Date exposing (Date) - -import Form exposing (Form) -import Form.Validate as Validate exposing (Validation) -import Validation - -type alias Model = - { addCategory : Form String AddCategory - } - -type alias AddCategory = - { amount : Int - , date : Date - } - -init : Model -init = - { addCategory = initForm - } - -initForm : Form String AddCategory -initForm = Form.initial [] validation - -validation : Validation String AddCategory -validation = - Validate.map2 AddCategory - (Validate.field "amount" (Validate.int |> Validate.andThen (Validate.minInt 1))) - (Validate.field "date" Validation.date) -- cgit v1.2.3