Skip to content

Commit 02b2301

Browse files
authored
Merge pull request #194 from mailjet/issue_#104
fix: problem with extra slash before query string values
2 parents 8252c71 + a99b44e commit 02b2301

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mailjet-client.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,16 @@ MailjetClient.prototype.path = function (resource, sub, params, options) {
249249
console.log('filters =', params)
250250
}
251251

252-
const url = (options && 'url' in options ? options.url : this.config.url)
253-
const api_version = (options && 'version' in options ? options.version : this.config.version)
252+
const url = (options && 'url' in options) ? options.url : this.config.url
253+
const api_version = (options && 'version' in options) ? options.version : this.config.version
254254

255-
var base = _path.join(api_version, sub)
255+
const base = _path.join(api_version, sub)
256256
if (Object.keys(params).length === 0) {
257257
return _path.join(url, base + '/' + resource)
258258
}
259259

260-
var q = qs.stringify(params);
261-
return _path.join(url, base + '/' + resource + '/?' + q)
260+
const querystring = qs.stringify(params);
261+
return _path.join(url, base + '/' + resource + '?' + querystring)
262262
}
263263

264264
/*

0 commit comments

Comments
 (0)