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/LoggedIn/Home/AddPayment/Update.elm | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/client/elm/LoggedIn/Home/AddPayment/Update.elm') diff --git a/src/client/elm/LoggedIn/Home/AddPayment/Update.elm b/src/client/elm/LoggedIn/Home/AddPayment/Update.elm index 7f5fb0a..46b3786 100644 --- a/src/client/elm/LoggedIn/Home/AddPayment/Update.elm +++ b/src/client/elm/LoggedIn/Home/AddPayment/Update.elm @@ -1,49 +1,49 @@ -module LoggedIn.Home.AddPayment.Update +module LoggedIn.Home.AddPayment.Update exposing ( update , addPaymentError - ) where + ) import Maybe import Json.Decode as Json exposing ((:=)) -import LoggedIn.Home.AddPayment.Action as AddPaymentAction +import LoggedIn.Home.AddPayment.Msg as AddPaymentMsg import LoggedIn.Home.AddPayment.Model as AddPaymentModel import Model.Translations exposing (Translations, getMessage) import Model.Payment exposing (Frequency(..)) -update : AddPaymentAction.Action -> AddPaymentModel.Model -> AddPaymentModel.Model +update : AddPaymentMsg.Msg -> AddPaymentModel.Model -> AddPaymentModel.Model update action addPayment = case action of - AddPaymentAction.NoOp -> + AddPaymentMsg.NoOp -> addPayment - AddPaymentAction.Init frequency -> + AddPaymentMsg.Init frequency -> AddPaymentModel.init frequency - AddPaymentAction.UpdateName name -> + AddPaymentMsg.UpdateName name -> { addPayment | name = name } - AddPaymentAction.UpdateCost cost -> + AddPaymentMsg.UpdateCost cost -> { addPayment | cost = cost } - AddPaymentAction.AddError nameError costError -> + AddPaymentMsg.AddError nameError costError -> { addPayment | nameError = nameError , costError = costError , waitingServer = False } - AddPaymentAction.ToggleFrequency -> + AddPaymentMsg.ToggleFrequency -> { addPayment | frequency = if addPayment.frequency == Punctual then Monthly else Punctual } - AddPaymentAction.WaitingServer -> + AddPaymentMsg.WaitingServer -> { addPayment | waitingServer = True } -addPaymentError : Translations -> String -> Maybe AddPaymentAction.Action +addPaymentError : Translations -> String -> Maybe AddPaymentMsg.Msg addPaymentError translations jsonErr = let decoder = Json.object2 (,) @@ -53,6 +53,6 @@ addPaymentError translations jsonErr = Err _ -> Nothing Ok (mbNameKey, mbCostKey) -> - Just <| AddPaymentAction.AddError + Just <| AddPaymentMsg.AddError (Maybe.map (flip getMessage translations) mbNameKey) (Maybe.map (flip getMessage translations) mbCostKey) -- cgit v1.2.3