Skip to content

Commit

Permalink
travic-ci-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
y.vanov committed Jun 11, 2018
1 parent 54c3d4c commit 2d889e2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mailjet-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ require('superagent-proxy')(request)
* https://www.mailjet.com/
*/
function MailjetClient (api_key, api_secret, options, perform_api_call) {
this.authStrategy(api_key, api_secret, options, perform_api_call)
return this.authStrategy(api_key, api_secret, options, perform_api_call)
}

/**
Expand All @@ -78,10 +78,10 @@ MailjetClient.prototype.authStrategy = function(api_key, api_secret, options, pe
// api_key becomes api_token
// api_secret becomes options
// options becomes perform_api_call
tokenAuthentication(api_key, api_secret, options)
return tokenAuthentication(api_key, api_secret, options)
} else {
// params are in correct order
basicAuthentication(api_key, api_secret, options, perform_api_call)
return basicAuthentication(api_key, api_secret, options, perform_api_call)
}

/**
Expand All @@ -100,6 +100,8 @@ MailjetClient.prototype.authStrategy = function(api_key, api_secret, options, pe
if (api_key && api_secret) {
self.connect(api_key, api_secret, options)
}

return self
}

/**
Expand All @@ -115,6 +117,8 @@ MailjetClient.prototype.authStrategy = function(api_key, api_secret, options, pe
if (api_token) {
self.connect(api_token, options)
}

return self
}
}

Expand Down Expand Up @@ -342,7 +346,7 @@ MailjetClient.prototype.httpRequest = function (method, url, data, callback, per
function MailjetResource (method, func, options, context) {
this.base = func
this.callUrl = func
this.options = options
this.options = options || context.options

this.resource = func.toLowerCase()

Expand Down

0 comments on commit 2d889e2

Please sign in to comment.