Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
feat: prettify json in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed May 15, 2020
1 parent f3350fb commit b8340a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Api/Request.purs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ type RequestOptions
}

-- Url to send requests to
newtype BaseUrl
= BaseUrl String
data BaseUrl
= BaseUrl String Boolean

-- Default request we can reuse troughout the app
defaultRequest :: BaseUrl -> RequestOptions -> Request Json
defaultRequest (BaseUrl baseUrl) { endpoint, method } =
defaultRequest (BaseUrl baseUrl pretty) { endpoint, method } =
{ method: Left method
, url: baseUrl <> print endpointCodec endpoint
, url: baseUrl <> print endpointCodec endpoint <> if pretty then "?pretty" else ""
, content: RB.json <$> body
, username: Nothing
, password: Nothing
Expand Down

0 comments on commit b8340a3

Please sign in to comment.