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.elm9
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