aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Server.elm
diff options
context:
space:
mode:
authorJoris2016-03-28 17:51:14 +0200
committerJoris2016-03-28 17:51:14 +0200
commit166cd04e4b28770ede854dafc9ae30eae64102fe (patch)
tree2245a31243a165acc6f7355534da44cfd17e6038 /src/client/elm/Server.elm
parentb0d80a5458d7ba4546e5f01f5b6398ea6d23f981 (diff)
downloadbudget-166cd04e4b28770ede854dafc9ae30eae64102fe.tar.gz
budget-166cd04e4b28770ede854dafc9ae30eae64102fe.tar.bz2
budget-166cd04e4b28770ede854dafc9ae30eae64102fe.zip
Create an empty but reachable user page
Diffstat (limited to 'src/client/elm/Server.elm')
-rw-r--r--src/client/elm/Server.elm22
1 files changed, 11 insertions, 11 deletions
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 ())