diff options
author | Joris | 2015-09-06 00:05:50 +0200 |
---|---|---|
committer | Joris | 2015-09-06 00:05:50 +0200 |
commit | 24633871359ec9fbd63fdfebf79a6351b2792f77 (patch) | |
tree | a87c8a964a3c5114da13e622c604cf99ab905a06 /src/client/ServerCommunication.elm | |
parent | 8c328987901973cd0ffd2e03cae547717ebbbc67 (diff) |
Can add monthly payments, not visible at the moment though, just the count is printed
Diffstat (limited to 'src/client/ServerCommunication.elm')
-rw-r--r-- | src/client/ServerCommunication.elm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/ServerCommunication.elm b/src/client/ServerCommunication.elm index c38805b..1f35fa1 100644 --- a/src/client/ServerCommunication.elm +++ b/src/client/ServerCommunication.elm @@ -13,6 +13,7 @@ import Date import Model.Message exposing (messageDecoder) import Model.User exposing (UserId) import Model.Payment exposing (PaymentId, perPage, paymentsDecoder) +import Model.View.Payment.Add exposing (Frequency) import Update as U import Update.SignIn exposing (..) @@ -21,7 +22,7 @@ import Update.Payment as UP type Communication = NoCommunication | SignIn String - | AddPayment UserId String Int + | AddPayment UserId String Int Frequency | DeletePayment PaymentId UserId Int Int | UpdatePage Int | SignOut @@ -45,8 +46,8 @@ getRequest communication = Nothing SignIn login -> Just (simple "post" ("/signIn?login=" ++ login)) - AddPayment userId paymentName cost -> - Just (simple "post" ("/payment/add?name=" ++ paymentName ++ "&cost=" ++ (toString cost))) + AddPayment userId paymentName cost frequency -> + Just (simple "post" ("/payment/add?name=" ++ paymentName ++ "&cost=" ++ (toString cost) ++ "&frequency=" ++ (toString frequency))) DeletePayment paymentId _ _ _ -> Just (simple "post" ("payment/delete?id=" ++ (toString paymentId))) UpdatePage page -> @@ -75,7 +76,7 @@ serverResult communication response = Task.succeed U.NoOp SignIn login -> Task.succeed (U.UpdateSignIn (ValidLogin login)) - AddPayment userId paymentName cost -> + AddPayment userId paymentName cost frequency -> Http.send Http.defaultSettings (updatePageRequest 1) |> Task.map (\response -> if response.status == 200 |