From 8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679 Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 3 Jun 2016 20:27:16 +0200 Subject: Migrate to elm 0.17 --- src/client/elm/Server.elm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/client/elm/Server.elm') diff --git a/src/client/elm/Server.elm b/src/client/elm/Server.elm index 36adb33..d56bc48 100644 --- a/src/client/elm/Server.elm +++ b/src/client/elm/Server.elm @@ -1,13 +1,12 @@ -module Server +module Server exposing ( signIn , addPayment , deletePayment , addIncome , deleteIncome , signOut - ) where + ) -import Signal import Task as Task exposing (Task) import Http import Json.Decode as Json exposing ((:=)) @@ -22,30 +21,30 @@ import Model.Init exposing (Init) signIn : String -> Task Http.Error () signIn email = - post ("/api/signIn?email=" ++ email) + post ("/signIn?email=" ++ email) |> Task.map (always ()) addPayment : String -> String -> Frequency -> Task Http.Error PaymentId addPayment name cost frequency = - post ("/api/payment/add?name=" ++ name ++ "&cost=" ++ cost ++ "&frequency=" ++ (toString frequency)) + post ("/payment/add?name=" ++ name ++ "&cost=" ++ cost ++ "&frequency=" ++ (toString frequency)) |> flip Task.andThen (decodeHttpValue <| "id" := paymentIdDecoder) deletePayment : PaymentId -> Task Http.Error () deletePayment paymentId = - delete ("/api/payment/delete?id=" ++ (toString paymentId)) + delete ("/payment?id=" ++ (toString paymentId)) |> Task.map (always ()) addIncome : Date -> Int -> Task Http.Error IncomeId addIncome creation amount = - post ("/api/income?creation=" ++ (toString << Date.toTime <| creation) ++ "&amount=" ++ (toString amount)) + post ("/income?creation=" ++ (toString << Date.toTime <| creation) ++ "&amount=" ++ (toString amount)) |> flip Task.andThen (decodeHttpValue <| "id" := incomeIdDecoder) deleteIncome : IncomeId -> Task Http.Error () deleteIncome incomeId = - delete ("/api/income/delete?id=" ++ (toString incomeId)) + delete ("/income?id=" ++ (toString incomeId)) |> Task.map (always ()) signOut : Task Http.Error () signOut = - post "/api/signOut" + post "/signOut" |> Task.map (always ()) -- cgit v1.2.3