diff options
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 |