diff options
author | Joris | 2016-01-03 19:41:31 +0100 |
---|---|---|
committer | Joris | 2016-01-03 19:41:31 +0100 |
commit | a8309988518af5bddf62d6a326d990fde4069b40 (patch) | |
tree | 6ff9c0af27d78f8579b5c3975378a3c82899593c /src/client/elm/Update | |
parent | 0cba27cba2b44756389d50bc113f23a2be87e978 (diff) |
Set focus properties to button elements
Diffstat (limited to 'src/client/elm/Update')
-rw-r--r-- | src/client/elm/Update/LoggedIn.elm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/elm/Update/LoggedIn.elm b/src/client/elm/Update/LoggedIn.elm index fe53af7..69a1b75 100644 --- a/src/client/elm/Update/LoggedIn.elm +++ b/src/client/elm/Update/LoggedIn.elm @@ -8,17 +8,15 @@ import Dict import Effects exposing (Effects) import Task -import ServerCommunication exposing (sendRequest) +import Server import Model exposing (Model) import Model.User exposing (UserId) import Model.Payment exposing (..) -import Model.Action exposing (..) import Model.Action.LoggedInAction exposing (..) import Model.Action.AccountAction exposing (..) import Model.Action.MonthlyAction as Monthly import Model.Action.AddPaymentAction as AddPayment -import Model.Communication as Communication exposing (Communication) import Model.View.LoggedInView exposing (..) import Model.View.LoggedIn.AddPayment exposing (..) @@ -26,10 +24,12 @@ import Update.LoggedIn.AddPayment exposing (updateAddPayment) import Update.LoggedIn.Monthly exposing (updateMonthly) import Update.LoggedIn.Account exposing (updateAccount) -updateLoggedIn : Model -> LoggedInAction -> LoggedInView -> (LoggedInView, Effects Action) +updateLoggedIn : Model -> LoggedInAction -> LoggedInView -> (LoggedInView, Effects LoggedInAction) updateLoggedIn model action loggedInView = case action of + NoOp -> (loggedInView, Effects.none) + UpdateAdd addPaymentAction -> ( { loggedInView | add = updateAddPayment addPaymentAction loggedInView.add } , Effects.none @@ -42,7 +42,7 @@ updateLoggedIn model action loggedInView = AddPayment name cost frequency -> ( { loggedInView | add = updateAddPayment AddPayment.WaitingServer loggedInView.add } - , sendRequest (Communication.AddPayment name cost frequency) + , Server.addPayment name cost frequency |> flip Task.onError (always <| Task.succeed NoOp) |> Effects.task ) @@ -75,6 +75,13 @@ updateLoggedIn model action loggedInView = ) DeletePayment payment frequency -> + ( loggedInView + , Server.deletePayment payment frequency + |> flip Task.onError (always <| Task.succeed NoOp) + |> Effects.task + ) + + ValidateDeletePayment payment frequency -> case frequency of Monthly -> ( { loggedInView |