Skip to content

Commit 69cb54b

Browse files
committed
🐛 Fix response
1 parent 804682a commit 69cb54b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/run.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ function run(url, body, cliOpts) {
2121

2222
// See: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
2323
fetch(apiUrl, opts)
24-
.then(res => res)
25-
.then(payload => {
26-
console.log(`status: ${payload.status} ${payload.statusText}`)
27-
const json = payload.json()
24+
.then(res => {
25+
console.log(`status: ${res.status} ${res.statusText}`)
26+
return res.json()
27+
})
28+
.then(json => {
2829
const url = new URL(apiUrl);
2930
const path = buildPath(url)
3031
const res = jsonToGo(JSON.stringify(json), path.struct);

0 commit comments

Comments
 (0)