aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-07-21 23:25:58 +0200
committerJoris Guyonvarch2015-07-21 23:25:58 +0200
commit2a53fe50c62d4b7aec0f422998c743f68aa523c1 (patch)
treead32464c99668b477c4006146ec218c947bc9c8f /src/client/Model
parenta271d6034bc4cc631a64476d25d21c83a701fa39 (diff)
downloadbudget-2a53fe50c62d4b7aec0f422998c743f68aa523c1.tar.gz
budget-2a53fe50c62d4b7aec0f422998c743f68aa523c1.tar.bz2
budget-2a53fe50c62d4b7aec0f422998c743f68aa523c1.zip
Adding the payment without reloading the page
Diffstat (limited to 'src/client/Model')
-rw-r--r--src/client/Model/Message.elm8
-rw-r--r--src/client/Model/View/PaymentView.elm10
2 files changed, 14 insertions, 4 deletions
diff --git a/src/client/Model/Message.elm b/src/client/Model/Message.elm
new file mode 100644
index 0000000..9f21fd3
--- /dev/null
+++ b/src/client/Model/Message.elm
@@ -0,0 +1,8 @@
+module Model.Message
+ ( messageDecoder
+ ) where
+
+import Json.Decode exposing (..)
+
+messageDecoder : Decoder String
+messageDecoder = ("message" := string)
diff --git a/src/client/Model/View/PaymentView.elm b/src/client/Model/View/PaymentView.elm
index cea7d2e..8de005d 100644
--- a/src/client/Model/View/PaymentView.elm
+++ b/src/client/Model/View/PaymentView.elm
@@ -6,14 +6,16 @@ module Model.View.PaymentView
import Model.Payment exposing (Payments)
type alias PaymentView =
- { name : String
+ { userName : String
+ , name : String
, cost : String
, payments : Payments
}
-initPaymentView : Payments -> PaymentView
-initPaymentView payments =
- { name = ""
+initPaymentView : String -> Payments -> PaymentView
+initPaymentView userName payments =
+ { userName = userName
+ , name = ""
, cost = ""
, payments = payments
}