Skip to content

Commit

Permalink
fix: syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ftgibran committed Aug 31, 2021
1 parent 9447e25 commit 1d0bd5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ export class Request {
}

addHeader(key: string, value: string) {
this.axiosConfig.headers ??= {}
if (!this.axiosConfig.headers) {
this.axiosConfig.headers = {}
}

this.axiosConfig.headers[key] = value
return this
}
Expand All @@ -110,7 +113,10 @@ export class Request {
}

addParams(key: string, value: string) {
this.axiosConfig.params ??= {}
if (!this.axiosConfig.params) {
this.axiosConfig.params = {}
}

this.axiosConfig.params[key] = value
return this
}
Expand Down

0 comments on commit 1d0bd5d

Please sign in to comment.