about summary refs log tree commit diff
path: root/client/src/Admin.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-01T22·04+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-01T22·04+0100
commit249e3113ffbcda047bd9461f01aaa64aa2dd94f1 (patch)
tree6f3edd19086b88a60e48fa66a74cbc501e776b35 /client/src/Admin.elm
parent54eb29eae0398dd19f5fdaed278f29453b0b7e44 (diff)
Support creating Trips from the frontend
*sigh* ... spent way too much time encoding/decoding date types...

I need my database, server, client, and JSON need to agree on types.

TL;DR:
- Add CSS for elm/datepicker library
- Create Common.allErrors to display UI errors
- Prefer Data.Time.Calendar.Day instead of newtype Date wrapper around Text
Diffstat (limited to 'client/src/Admin.elm')
-rw-r--r--client/src/Admin.elm20
1 files changed, 2 insertions, 18 deletions
diff --git a/client/src/Admin.elm b/client/src/Admin.elm
index 3c0f221d93ed..e8e33bde617b 100644
--- a/client/src/Admin.elm
+++ b/client/src/Admin.elm
@@ -5,6 +5,7 @@ import Html.Attributes exposing (..)
 import Html.Events exposing (..)
 import RemoteData
 import State
+import Common
 import Tailwind
 import UI
 import Utils
@@ -78,22 +79,5 @@ render model =
         , case model.adminTab of
             State.Users ->
                 allUsers model
-        , case model.logoutError of
-            Nothing ->
-                text ""
-
-            Just e ->
-                UI.errorBanner
-                    { title = "Error logging out"
-                    , body = Utils.explainHttpError e
-                    }
-        , case model.deleteUserError of
-            Nothing ->
-                text ""
-
-            Just e ->
-                UI.errorBanner
-                    { title = "Error attempting to delete user"
-                    , body = Utils.explainHttpError e
-                    }
+        , Common.allErrors model
         ]