diff options
author | Joris Guyonvarch | 2015-07-20 21:55:52 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-07-20 21:55:52 +0200 |
commit | a271d6034bc4cc631a64476d25d21c83a701fa39 (patch) | |
tree | 89ffa3df69999c5c9ed3cda9f4e4ec04f7a6ae1d /src/client/ServerCommunication.elm | |
parent | a40c4825996c90d107901b0d71162f9356f1395a (diff) |
Add a payment from the UI, it needs polishing however
Diffstat (limited to 'src/client/ServerCommunication.elm')
-rw-r--r-- | src/client/ServerCommunication.elm | 12 |
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 |