Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
add webhookURI to opts in webhook apis (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
songgao authored Feb 3, 2020
1 parent c9d0903 commit 7bbcf61
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions api/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ function WebhookClient(jiraClient) {
* @method getWebhook
* @memberOf WebhookClient#
* @param opts The options sent to the JIRA API.
* @param opts.webhookId The numerical webhook ID.
* @param opts.webhookURI The URI of the webhook to delete.
* @param opts.webhookId The numerical webhook ID. This is only used if webhookURI is falsey.
* @param [callback] Called when the webhook has been retrieved.
* @return {Promise} Resolved when the webhook has been retrieved.
*/
this.getWebhook = function (opts, callback) {
var options = {
uri: this.jiraClient.buildWebhookURL('/webhook/' + opts.webhookId),
uri: opts.webhookURI || this.jiraClient.buildWebhookURL('/webhook/' + opts.webhookId),
method: 'GET',
json: true,
followAllRedirects: true
Expand Down Expand Up @@ -87,13 +88,14 @@ function WebhookClient(jiraClient) {
* @method deleteWebhook
* @memberOf WebhookClient#
* @param opts The options sent to the JIRA API.
* @param opts.webhookId The numerical webhook ID.
* @param [callback] Called when the webhook has been retrieved.
* @return {Promise} Resolved when the webhook has been retrieved.
* @param opts.webhookURI The URI of the webhook to delete.
* @param opts.webhookId The numerical webhook ID. This is only used if webhookURI is falsey.
* @param [callback] Called when the webhook has been deleted.
* @return {Promise} Resolved when the webhook has been deleted.
*/
this.deleteWebhook = function (opts, callback) {
var options = {
uri: this.jiraClient.buildWebhookURL('/webhook/' + opts.webhookId),
uri: opts.webhookURI || this.jiraClient.buildWebhookURL('/webhook/' + opts.webhookId),
method: 'DELETE',
json: true,
followAllRedirects: true
Expand Down

0 comments on commit 7bbcf61

Please sign in to comment.