Skip to content

Commit

Permalink
fix: get body from response
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 7, 2024
1 parent 465f3e1 commit ec13168
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"microlink"
],
"dependencies": {
"@microlink/mql": "~0.13.4",
"@microlink/mql": "~0.13.5",
"clipboardy": "~2.3.0",
"jsome": "~2.5.0",
"localhost-url-regex": "~1.0.9",
"localhost-url-regex": "~1.0.11",
"mri": "~1.2.0",
"nanospinner": "~1.1.0",
"picocolors": "~1.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ const fetch = async (cli, gotOpts) => {

try {
spinner.start()
const { body, response } = await mql.buffer(url, mqlOpts, gotOpts)
const response = await mql.buffer(url, mqlOpts, gotOpts)
spinner.stop()
return { body, response, flags: { copy, pretty } }
return { response, flags: { copy, pretty } }
} catch (error) {
spinner.stop()
error.flags = cli.flags
throw error
}
}

const render = ({ body, response, flags }) => {
const { headers, timings, requestUrl: uri } = response
const render = ({ response, flags }) => {
const { headers, timings, requestUrl: uri, body } = response
if (!flags.pretty) return console.log(body.toString())

const contentType = headers['content-type'].toLowerCase()
Expand Down

0 comments on commit ec13168

Please sign in to comment.