Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Fix fetch' context issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rogaldh committed Jan 16, 2020
1 parent a9c6839 commit 47f3ffb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/http-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ export class FetchHttpClient {
return this
}
get (url, config) {
return this.__fetch(url, {
return this.__fetch.call(null, url, {
method: 'GET',
headers: config.headers
})
.then(FetchHttpClient._processResponse)
}
post (url, data, config) {
return this.__fetch(url, {
return this.__fetch.call(null, url, {
method: 'POST',
headers: config.headers,
body: JSON.stringify(data)
})
.then(FetchHttpClient._processResponse)
}
patch (url, data, config) {
return this.__fetch(url, {
return this.__fetch.call(null, url, {
method: 'PATCH',
headers: config.headers,
body: JSON.stringify(data)
})
.then(FetchHttpClient._processResponse)
}
delete (url, data, config) {
return this.__fetch(url, {
return this.__fetch.call(null, url, {
method: 'DELETE',
headers: config.headers,
body: JSON.stringify(data)
Expand Down

0 comments on commit 47f3ffb

Please sign in to comment.