aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/app/Schema.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/frontend/app/Schema.hs b/frontend/app/Schema.hs
index 5f4ddae..5265d57 100644
--- a/frontend/app/Schema.hs
+++ b/frontend/app/Schema.hs
@@ -11,9 +11,9 @@ where
import ACMS.API.REST.Collection.Paginated (Paginated (..))
import Control.Applicative ((<|>))
import Data.Aeson qualified as A
+import Data.Aeson.Encoding.Internal qualified as AE
import Data.Aeson.Key qualified as AK
import Data.Aeson.KeyMap qualified as AM
-import Data.List
import Data.Map qualified as M
import Data.Maybe
import Data.Scientific (fromFloatDigits)
@@ -51,7 +51,13 @@ instance A.FromJSON Schema where
#ifdef ghcjs_HOST_OS
instance A.FromJSONKey MisoString where
- fromJSONKey = fromMisoString <$> A.fromJSONKey
+ fromJSONKey = A.FromJSONKeyText toMisoString
+
+instance A.ToJSONKey MisoString where
+ toJSONKey =
+ A.ToJSONKeyText
+ (AK.fromText . fromMisoString)
+ (AE.key . AK.fromText . fromMisoString)
#endif
data Property
@@ -99,7 +105,7 @@ schemaTable collection schema paginated =
thead_ [] $
[ tr_ [] $
[ th_ [] [text (toMisoString k)]
- | k <- M.keys schema.properties
+ | k <- M.keys schema.properties
]
]
tbody =
@@ -128,9 +134,9 @@ schemaTable collection schema paginated =
A.String s -> toMisoString s
_ -> toMisoString (A.encode v)
]
- | (k, p) <- M.assocs schema.properties
+ | (k, p) <- M.assocs schema.properties
]
- | value <- paginated.data_
+ | value <- paginated.data_
]
tfoot =
let page, lastPage, perPage :: Int