diff options
Diffstat (limited to 'src/client/Main.elm')
-rw-r--r-- | src/client/Main.elm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/Main.elm b/src/client/Main.elm index 57e41d4..6ca2743 100644 --- a/src/client/Main.elm +++ b/src/client/Main.elm @@ -9,7 +9,7 @@ import Html exposing (Html) import Http import Task exposing (..) import Time exposing (..) -import Json.Decode as Json +import Json.Decode as Json exposing ((:=)) import Model exposing (Model, initialModel) import Model.Payment exposing (Payments, paymentsDecoder) @@ -56,7 +56,7 @@ port initView = Just msg -> Signal.send actions.address (SignInError msg) Nothing -> - Task.map3 GoPaymentView getUserName getPayments getPayers + Task.map4 GoPaymentView getUserName getPayments getPaymentsCount getPayers |> flip Task.andThen (Signal.send actions.address) |> flip Task.onError (\_ -> Signal.send actions.address GoSignInView) @@ -66,6 +66,9 @@ getUserName = Http.get messageDecoder "/userName" getPayments : Task Http.Error Payments getPayments = Http.get paymentsDecoder "/payments" +getPaymentsCount : Task Http.Error Int +getPaymentsCount = Http.get ("number" := Json.int) "/payments/count" + getPayers : Task Http.Error Payers getPayers = Http.get payersDecoder "/payments/total" |