diff options
Diffstat (limited to 'src/client/elm/Server.elm')
-rw-r--r-- | src/client/elm/Server.elm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/elm/Server.elm b/src/client/elm/Server.elm index c1fb445..314ca01 100644 --- a/src/client/elm/Server.elm +++ b/src/client/elm/Server.elm @@ -17,7 +17,7 @@ import Time exposing (Time) import Utils.Http exposing (..) import Model.Payment exposing (..) -import Model.Payer exposing (Payers, payersDecoder) +import Model.Income exposing (incomesDecoder, incomeIdDecoder, IncomeId) import Model.User exposing (Users, usersDecoder, UserId, userIdDecoder) import Model.Init exposing (Init) @@ -28,7 +28,7 @@ init = `Task.andMap` (Http.get paymentsDecoder "/payments") `Task.andMap` (Http.get paymentsDecoder "/monthlyPayments") `Task.andMap` (Http.get ("number" := Json.int) "/payments/count") - `Task.andMap` (Http.get payersDecoder "/payers") + `Task.andMap` (Http.get incomesDecoder "/incomes") signIn : String -> Task Http.Error () signIn email = @@ -45,10 +45,10 @@ deletePayment payment frequency = post ("payment/delete?id=" ++ (toString payment.id)) |> Task.map (always ()) -setIncome : Time -> Int -> Task Http.Error () +setIncome : Time -> Int -> Task Http.Error IncomeId setIncome currentTime amount = post ("/income?amount=" ++ (toString amount)) - |> Task.map (always ()) + |> flip Task.andThen (decodeHttpValue <| "id" := incomeIdDecoder) signOut : Task Http.Error () signOut = |