diff options
author | Joris | 2016-01-02 22:19:40 +0100 |
---|---|---|
committer | Joris | 2016-01-02 22:19:40 +0100 |
commit | 25d15aacb940c2a19cae3b2e3d8d3ebd1972be02 (patch) | |
tree | 6a418a7a31b713a1d39bdb2da1f798ca07266fe1 /src/client/elm/ServerCommunication.elm | |
parent | 35493d8ec353f90a6ca67e2aedb702684e0abafa (diff) |
Merge AddPayment and AddMonthlyPayment
Diffstat (limited to 'src/client/elm/ServerCommunication.elm')
-rw-r--r-- | src/client/elm/ServerCommunication.elm | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/client/elm/ServerCommunication.elm b/src/client/elm/ServerCommunication.elm index bc8d59f..1cabda5 100644 --- a/src/client/elm/ServerCommunication.elm +++ b/src/client/elm/ServerCommunication.elm @@ -33,15 +33,10 @@ sendRequest communication = post ("/signIn?assertion=" ++ assertion) |> flip Task.andThen (always initViewAction) - AddPayment name cost -> - post (addPaymentURL name cost Punctual) + AddPayment name cost frequency -> + post (addPaymentURL name cost frequency) |> flip Task.andThen (decodeHttpValue <| "id" := paymentIdDecoder) - |> Task.map (\paymentId -> (U.UpdateLoggedIn (UL.AddPayment paymentId name cost))) - - AddMonthlyPayment name cost -> - post (addPaymentURL name cost Monthly) - |> flip Task.andThen (decodeHttpValue <| "id" := paymentIdDecoder) - |> Task.map (\id -> U.UpdateLoggedIn (UL.AddMonthlyPayment id name cost)) + |> Task.map (\paymentId -> (U.UpdateLoggedIn (UL.AddPayment paymentId name cost frequency))) DeletePayment payment currentPage -> post (deletePaymentURL payment.id) |