aboutsummaryrefslogtreecommitdiff
path: root/src/client/ServerCommunication.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-07-20 21:55:52 +0200
committerJoris Guyonvarch2015-07-20 21:55:52 +0200
commita271d6034bc4cc631a64476d25d21c83a701fa39 (patch)
tree89ffa3df69999c5c9ed3cda9f4e4ec04f7a6ae1d /src/client/ServerCommunication.elm
parenta40c4825996c90d107901b0d71162f9356f1395a (diff)
downloadbudget-a271d6034bc4cc631a64476d25d21c83a701fa39.tar.gz
budget-a271d6034bc4cc631a64476d25d21c83a701fa39.tar.bz2
budget-a271d6034bc4cc631a64476d25d21c83a701fa39.zip
Add a payment from the UI, it needs polishing however
Diffstat (limited to 'src/client/ServerCommunication.elm')
-rw-r--r--src/client/ServerCommunication.elm12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/ServerCommunication.elm b/src/client/ServerCommunication.elm
index d581f82..d763e29 100644
--- a/src/client/ServerCommunication.elm
+++ b/src/client/ServerCommunication.elm
@@ -16,6 +16,7 @@ import Update.SignIn exposing (..)
type Communication =
NoCommunication
| SignIn String
+ | AddPayment String String
| SignOut
serverCommunications : Signal.Mailbox Communication
@@ -42,6 +43,13 @@ getRequest communication =
, url = "/signIn?login=" ++ login
, body = Http.empty
}
+ AddPayment name cost ->
+ Just
+ { verb = "post"
+ , headers = []
+ , url = "/payment/add?name=" ++ name ++ "&cost=" ++ cost
+ , body = Http.empty
+ }
SignOut ->
Just
{ verb = "post"
@@ -59,8 +67,10 @@ communicationToAction communication response =
U.NoOp
SignIn login ->
U.UpdateSignIn (ValidLogin login)
+ AddPayment _ _ ->
+ U.NoOp
SignOut ->
- U.SignIn
+ U.GoSignInView
else
decodeResponse
response