aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Server.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Server.elm')
-rw-r--r--src/client/elm/Server.elm17
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 ())