diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-06-05 22:47:49 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-06-05 23:36:34 +0200 |
commit | bfb98d7675515394e1b9a0417bfafc83d775611c (patch) | |
tree | dec841dc2ca6b79f8eaa777b90b3b1473f369c9d /frontend/app/Api.hs | |
parent | 2064b4e7767dca2858d8093597503a594dcd74ef (diff) |
add schema version
Diffstat (limited to 'frontend/app/Api.hs')
-rw-r--r-- | frontend/app/Api.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/frontend/app/Api.hs b/frontend/app/Api.hs index c16e269..f4e4599 100644 --- a/frontend/app/Api.hs +++ b/frontend/app/Api.hs @@ -2,6 +2,7 @@ module Api ( fetchSchema, + fetchSchemaVersion, fetchPosts, fetchPost, updatePost, @@ -25,11 +26,16 @@ import Data.Function import Miso import Safe import Schema +import Version fetchSchema :: JSM (Either String Schema) fetchSchema = A.eitherDecode <$> fetch (fromString "http://localhost:8081/posts.schema.json") +fetchSchemaVersion :: JSM (Either String Version) +fetchSchemaVersion = + A.eitherDecode <$> fetch (fromString "http://localhost:8081/schemaVersion") + fetchPosts :: JSM (Either String [A.Value]) fetchPosts = A.eitherDecode |