diff options
author | Joris | 2016-06-03 20:27:16 +0200 |
---|---|---|
committer | Joris | 2016-06-03 20:27:16 +0200 |
commit | 8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679 (patch) | |
tree | d6ba0985a534a0e2e317b1edb0d4c999119d87ff /src/client/elm/Server.elm | |
parent | 3a88115d118f8256f3ff034dc359df42a9e4051c (diff) | |
download | budget-8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679.tar.gz budget-8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679.tar.bz2 budget-8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679.zip |
Migrate to elm 0.17
Diffstat (limited to 'src/client/elm/Server.elm')
-rw-r--r-- | src/client/elm/Server.elm | 17 |
1 files changed, 8 insertions, 9 deletions
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 ()) |