Skip to content

Commit

Permalink
fix: post requests to stringify data contents instead of data attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Grohs authored and Adam Grohs committed Apr 12, 2019
1 parent ade787f commit cef4dbe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class createClient {

const body = customHeaders['Content-Type']
? data
: { body: JSON.stringify({ data }) }
: { body: JSON.stringify({ ...data }) }

const response = await this.fetch(uri, {
method,
Expand Down Expand Up @@ -91,6 +91,8 @@ export class createClient {
}

post(path: string, data: object, headers?: Headers) {
console.log('!!path', path)
console.log('!!data', data)
return this.request('POST', path, data, headers)
}

Expand Down

0 comments on commit cef4dbe

Please sign in to comment.