Skip to content

Commit

Permalink
added empty check objects for request params
Browse files Browse the repository at this point in the history
  • Loading branch information
test committed Jul 22, 2019
1 parent 052815f commit 760fdde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/clients/clientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default abstract class ClientFactory {
this.authTypes = config.authTypes;
this.basePath = config.basePath;
this.pathParams = config.pathParams;
this.queryParams = config.pathParams;
this.queryParams = config.queryParams;
this.headerParams = config.headerParams;
this.formParams = config.formParams;
this.timeout = config.timeout || 60000;
Expand Down
4 changes: 2 additions & 2 deletions src/clients/superAgentClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export default class SuperAgentClient extends ClientFactory {
let request = Superagent(httpMethod, url);
request = this.applyAuthToRequest(request, this.authTypes);

if (this.queryParams) {
if (this.queryParams && Object.keys(this.queryParams).length) {
request.query(this.normalizeParams(this.queryParams));
}

if (this.headerParams) {
if (this.headerParams && Object.keys(this.headerParams).length) {
request.set(this.normalizeParams(this.headerParams));
}

Expand Down

0 comments on commit 760fdde

Please sign in to comment.