aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/LoggedIn/Home/AddPayment/Update.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/LoggedIn/Home/AddPayment/Update.elm')
-rw-r--r--src/client/elm/LoggedIn/Home/AddPayment/Update.elm26
1 files changed, 13 insertions, 13 deletions
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)