add schema version
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user