From a271d6034bc4cc631a64476d25d21c83a701fa39 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 20 Jul 2015 21:55:52 +0200 Subject: Add a payment from the UI, it needs polishing however --- src/client/ServerCommunication.elm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/client/ServerCommunication.elm') 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 -- cgit v1.2.3