aboutsummaryrefslogtreecommitdiff
path: root/src/client/ServerCommunication.elm
diff options
context:
space:
mode:
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