list collections
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
|
||||
|
||||
module Api
|
||||
( fetchSchema,
|
||||
( fetchCollections,
|
||||
fetchSchema,
|
||||
fetchSchemaVersion,
|
||||
fetchPosts,
|
||||
fetchPost,
|
||||
@@ -28,14 +29,18 @@ import Safe
|
||||
import Schema
|
||||
import Version
|
||||
|
||||
fetchSchema :: JSM (Either String Schema)
|
||||
fetchSchema =
|
||||
A.eitherDecode <$> fetch (fromString "http://localhost:8081/posts.schema.json")
|
||||
fetchCollections :: JSM (Either String [String])
|
||||
fetchCollections =
|
||||
A.eitherDecode <$> fetch (fromString "http://localhost:8081/collections")
|
||||
|
||||
fetchSchemaVersion :: JSM (Either String Version)
|
||||
fetchSchemaVersion =
|
||||
A.eitherDecode <$> fetch (fromString "http://localhost:8081/schemaVersion")
|
||||
|
||||
fetchSchema :: JSM (Either String Schema)
|
||||
fetchSchema =
|
||||
A.eitherDecode <$> fetch (fromString "http://localhost:8081/posts.schema.json")
|
||||
|
||||
fetchPosts :: JSM (Either String [A.Value])
|
||||
fetchPosts =
|
||||
A.eitherDecode
|
||||
|
||||
Reference in New Issue
Block a user