aboutsummaryrefslogtreecommitdiff
path: root/src/client/Dialog/AddPayment
diff options
context:
space:
mode:
authorJoris2017-03-26 23:16:28 +0200
committerJoris2017-03-27 00:17:41 +0200
commit902acfbdbcc1d59941399753e887479e586e2748 (patch)
tree0ad90ead3f8bdf0ea7c94462d1577c8e188df469 /src/client/Dialog/AddPayment
parent8062f1c9c34e9b25d76b22bd6ba2a1a99666279b (diff)
Improve form validation
- Trim names - Income amount accepted from 0 - Validate colors
Diffstat (limited to 'src/client/Dialog/AddPayment')
-rw-r--r--src/client/Dialog/AddPayment/View.elm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/Dialog/AddPayment/View.elm b/src/client/Dialog/AddPayment/View.elm
index 078d5b7..66c9f00 100644
--- a/src/client/Dialog/AddPayment/View.elm
+++ b/src/client/Dialog/AddPayment/View.elm
@@ -86,10 +86,10 @@ submitForm categories paymentCategories addPayment =
Just paymentId ->
Msg.Dialog
<| Dialog.UpdateAndClose
- <| Msg.EditPayment paymentId data.name data.cost data.date data.category data.frequency
+ <| Msg.EditPayment paymentId (String.trim data.name) data.cost data.date data.category data.frequency
Nothing ->
Msg.Dialog
<| Dialog.UpdateAndClose
- <| Msg.CreatePayment data.name data.cost data.date data.category data.frequency
+ <| Msg.CreatePayment (String.trim data.name) data.cost data.date data.category data.frequency
Nothing ->
Msg.Dialog <| Dialog.Update <| DialogMsg.AddPaymentMsg categories paymentCategories <| Form.Submit