[Typescript] Fix typescript-inversify compiler errors (#3607)

* Update addJsonHeaders 

addJsonHeaders currently throws a compiler error because the headers args in get/put/post etc is nullable, but the argument in addJsonHeaders is not

* Executed samples generator
This commit is contained in:
siada
2019-08-12 06:46:55 +01:00
committed by Esteban Gehring
parent 4b6499c636
commit c8a65a9942
2 changed files with 4 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ class HttpClient implements IHttpClient {
return !(body instanceof FormData) ? JSON.stringify(body) : body;
}
private addJsonHeaders(headers: Headers) {
private addJsonHeaders(headers?: Headers) {
return Object.assign({}, {
"Accept": "application/json",
"Content-Type": "application/json"
@@ -77,4 +77,4 @@ class HttpClient implements IHttpClient {
}
}
export default HttpClient
export default HttpClient

View File

@@ -35,7 +35,7 @@ class HttpClient implements IHttpClient {
return !(body instanceof FormData) ? JSON.stringify(body) : body;
}
private addJsonHeaders(headers: Headers) {
private addJsonHeaders(headers?: Headers) {
return Object.assign({}, {
"Accept": "application/json",
"Content-Type": "application/json"
@@ -67,4 +67,4 @@ class HttpClient implements IHttpClient {
}
}
export default HttpClient
export default HttpClient