diff --git a/api/comment.js b/api/comment.js index 8a1e846c..252954d7 100644 --- a/api/comment.js +++ b/api/comment.js @@ -111,7 +111,6 @@ function CommentClient(jiraClient) { } var basePath = '/comment/' + opts.commentId + "/properties"; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -128,9 +127,9 @@ function CommentClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/filter.js b/api/filter.js index 55ef490d..dd164113 100644 --- a/api/filter.js +++ b/api/filter.js @@ -256,7 +256,6 @@ function FilterClient(jiraClient) { this.buildRequestOptions = function (opts, path, method, body, qs) { var basePath = '/filter/' + opts.filterId; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -275,9 +274,9 @@ function FilterClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/issue.js b/api/issue.js index d951c5a5..17e6f085 100644 --- a/api/issue.js +++ b/api/issue.js @@ -1298,7 +1298,6 @@ function IssueClient(jiraClient) { var idOrKey = opts.issueId || opts.issueKey; var basePath = '/issue/' + idOrKey; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -1322,9 +1321,9 @@ function IssueClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/project.js b/api/project.js index 7cc1e7b3..1a864371 100644 --- a/api/project.js +++ b/api/project.js @@ -299,7 +299,6 @@ function ProjectClient(jiraClient) { var basePath = opts.projectIdOrKey ? '/project/' + opts.projectIdOrKey : '/project'; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -318,9 +317,9 @@ function ProjectClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/screens.js b/api/screens.js index bf392a67..af564527 100644 --- a/api/screens.js +++ b/api/screens.js @@ -220,7 +220,6 @@ function ScreensClient(jiraClient) { this.buildRequestOptions = function (opts, path, method, body, qs) { var basePath = '/screens/' + opts.screenId; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -239,9 +238,9 @@ function ScreensClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/version.js b/api/version.js index fa47d4cc..9f97ea11 100644 --- a/api/version.js +++ b/api/version.js @@ -293,7 +293,6 @@ function VersionClient(jiraClient) { this.buildRequestOptions = function (opts, path, method, body, qs) { var basePath = '/version/' + opts.versionId; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -312,9 +311,9 @@ function VersionClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true diff --git a/api/workflowScheme.js b/api/workflowScheme.js index 811dbe76..bfdf843d 100644 --- a/api/workflowScheme.js +++ b/api/workflowScheme.js @@ -490,7 +490,6 @@ function WorkflowSchemeClient(jiraClient) { this.buildRequestOptions = function (opts, path, method, body, qs) { var basePath = '/workflowscheme/' + opts.workflowSchemeId; if (!qs) qs = {}; - if (!body) body = {}; if (opts.fields) { qs.fields = ''; @@ -509,9 +508,9 @@ function WorkflowSchemeClient(jiraClient) { } return { + ...(body && { body }), uri: this.jiraClient.buildURL(basePath + path), method: method, - body: body, qs: qs, followAllRedirects: true, json: true