aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model/View/LoggedIn/AddPayment.elm
diff options
context:
space:
mode:
authorJoris2016-01-03 23:37:14 +0100
committerJoris2016-01-03 23:46:19 +0100
commitd9df5c3fcffe12aac239b58ccf2fd82c19c3be62 (patch)
treeaee62828e85c9d30e2beb5954062942f0d5d53f4 /src/client/elm/Model/View/LoggedIn/AddPayment.elm
parentd22d10da342520163014dda255d5d9bd5e1a80c0 (diff)
downloadbudget-d9df5c3fcffe12aac239b58ccf2fd82c19c3be62.tar.gz
budget-d9df5c3fcffe12aac239b58ccf2fd82c19c3be62.tar.bz2
budget-d9df5c3fcffe12aac239b58ccf2fd82c19c3be62.zip
Validate add payment server side
Diffstat (limited to 'src/client/elm/Model/View/LoggedIn/AddPayment.elm')
-rw-r--r--src/client/elm/Model/View/LoggedIn/AddPayment.elm16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/client/elm/Model/View/LoggedIn/AddPayment.elm b/src/client/elm/Model/View/LoggedIn/AddPayment.elm
index 3a14b00..c7680bb 100644
--- a/src/client/elm/Model/View/LoggedIn/AddPayment.elm
+++ b/src/client/elm/Model/View/LoggedIn/AddPayment.elm
@@ -1,13 +1,10 @@
module Model.View.LoggedIn.AddPayment
( AddPayment
, initAddPayment
- , validateName
- , validateCost
) where
import Result as Result exposing (Result(..))
-
-import Utils.Validation exposing (..)
+import Json.Decode exposing ((:=))
import Model.Translations exposing (..)
import Model.Payment exposing (PaymentFrequency(..))
@@ -30,14 +27,3 @@ initAddPayment frequency =
, frequency = frequency
, waitingServer = False
}
-
-validateName : String -> Translations -> Result String String
-validateName name translations =
- name
- |> validateNonEmpty (getMessage "CategoryRequired" translations)
-
-validateCost : String -> Translations -> Result String Int
-validateCost cost translations =
- cost
- |> validateNonEmpty (getMessage "CostRequired" translations)
- |> flip Result.andThen (validateNumber (getMessage "CostRequired" translations) ((/=) 0))