From 166cd04e4b28770ede854dafc9ae30eae64102fe Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 28 Mar 2016 17:51:14 +0200 Subject: Create an empty but reachable user page --- src/client/elm/Server.elm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/client/elm/Server.elm') diff --git a/src/client/elm/Server.elm b/src/client/elm/Server.elm index 314ca01..b6928de 100644 --- a/src/client/elm/Server.elm +++ b/src/client/elm/Server.elm @@ -23,34 +23,34 @@ import Model.Init exposing (Init) init : Task Http.Error Init init = - Task.map Init (Http.get usersDecoder "/users") - `Task.andMap` (Http.get ("id" := userIdDecoder) "/whoAmI") - `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 incomesDecoder "/incomes") + Task.map Init (Http.get usersDecoder "/api/users") + `Task.andMap` (Http.get ("id" := userIdDecoder) "/api/whoAmI") + `Task.andMap` (Http.get paymentsDecoder "/api/payments") + `Task.andMap` (Http.get paymentsDecoder "/api/monthlyPayments") + `Task.andMap` (Http.get ("number" := Json.int) "/api/payments/count") + `Task.andMap` (Http.get incomesDecoder "/api/incomes") signIn : String -> Task Http.Error () signIn email = - post ("/signIn?email=" ++ email) + post ("/api/signIn?email=" ++ email) |> Task.map (always ()) addPayment : String -> String -> PaymentFrequency -> Task Http.Error PaymentId addPayment name cost frequency = - post ("/payment/add?name=" ++ name ++ "&cost=" ++ cost ++ "&frequency=" ++ (toString frequency)) + post ("/api/payment/add?name=" ++ name ++ "&cost=" ++ cost ++ "&frequency=" ++ (toString frequency)) |> flip Task.andThen (decodeHttpValue <| "id" := paymentIdDecoder) deletePayment : Payment -> PaymentFrequency -> Task Http.Error () deletePayment payment frequency = - post ("payment/delete?id=" ++ (toString payment.id)) + post ("/api/payment/delete?id=" ++ (toString payment.id)) |> Task.map (always ()) setIncome : Time -> Int -> Task Http.Error IncomeId setIncome currentTime amount = - post ("/income?amount=" ++ (toString amount)) + post ("/api/income?amount=" ++ (toString amount)) |> flip Task.andThen (decodeHttpValue <| "id" := incomeIdDecoder) signOut : Task Http.Error () signOut = - post "/signOut" + post "/api/signOut" |> Task.map (always ()) -- cgit v1.2.3