This commit is contained in:
MasseR committed 2018-08-06 00:09:41 +03:00
1 parent c5d3f8d2e7
commit 881c53493f
2 files changed
+48 -16

No files matched your search

+3
View File
@@ -32,12 +32,15 @@ data JsonBook = JsonBook { contentType :: Text
, channels :: [JsonChannel] }
deriving (Generic, Show)
instance ToJSON JsonBook
instance FromJSON JsonBook
type API = Auth '[SA.BasicAuth, SA.JWT] SafeUser :> BaseAPI
type BaseAPI = "books" :> Get '[JSON] [JsonBook]
-- :<|> "books" :> ReqBody '[JSON] JsonBook :> PUT JsonBook
-- :<|> "books" :> Param "book_id" BookID :> ReqBody '[JSON] JsonBook :> PUT JsonBook
handler :: ServerT API AppM
handler user = listBooksHandler user