aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Main.elm1
-rw-r--r--src/client/Model/Message.elm8
-rw-r--r--src/client/ServerCommunication.elm19
3 files changed, 9 insertions, 19 deletions
diff --git a/src/client/Main.elm b/src/client/Main.elm
index e59692a..0b579d7 100644
--- a/src/client/Main.elm
+++ b/src/client/Main.elm
@@ -15,7 +15,6 @@ import Model exposing (Model, initialModel)
import Model.User exposing (Users, usersDecoder, UserId, userIdDecoder)
import Model.Payment exposing (Payments, paymentsDecoder, perPage)
import Model.Payers exposing (Payers, payersDecoder)
-import Model.Message exposing (messageDecoder)
import Model.Translations exposing (..)
import Update exposing (Action(..), actions, updateModel)
diff --git a/src/client/Model/Message.elm b/src/client/Model/Message.elm
deleted file mode 100644
index 9f21fd3..0000000
--- a/src/client/Model/Message.elm
+++ /dev/null
@@ -1,8 +0,0 @@
-module Model.Message
- ( messageDecoder
- ) where
-
-import Json.Decode exposing (..)
-
-messageDecoder : Decoder String
-messageDecoder = ("message" := string)
diff --git a/src/client/ServerCommunication.elm b/src/client/ServerCommunication.elm
index fefbbff..5736f77 100644
--- a/src/client/ServerCommunication.elm
+++ b/src/client/ServerCommunication.elm
@@ -10,7 +10,6 @@ import Http
import Json.Decode exposing (..)
import Date
-import Model.Message exposing (messageDecoder)
import Model.User exposing (UserId)
import Model.Payment exposing (..)
import Model.View.LoggedIn.Add exposing (Frequency(..))
@@ -108,16 +107,16 @@ serverResult communication response =
SignOut ->
Task.succeed (U.GoSignInView)
errorStatus ->
- decodeResponse
- messageDecoder
- (\error ->
- case communication of
- SignIn _ ->
+ case communication of
+ SignIn _ ->
+ decodeResponse
+ ("error" := string)
+ (\error ->
Task.succeed <| U.UpdateSignIn (ErrorLogin error)
- _ ->
- Task.succeed <| U.NoOp
- )
- response
+ )
+ response
+ _ ->
+ Task.succeed <| U.NoOp
decodeOkResponse : Decoder a -> (a -> Task b U.Action) -> Http.Response -> Task b U.Action
decodeOkResponse decoder responseToAction response =