Skip to content

Commit

Permalink
PP-11681 Add 'status' query parameter to webhook messages url if avai…
Browse files Browse the repository at this point in the history
…lable.
  • Loading branch information
JFSGDS committed Feb 29, 2024
1 parent d7e3449 commit df2cfa3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/services/clients/webhooks.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ async function attempts (messageId, webhookId, options = {}) {
async function messages (id, options = {}) {
const url = urlJoin(defaultRequestOptions.baseUrl,'/v1/webhook', id, 'message')
this.client = new Client(defaultRequestOptions.service)
const fullUrl = `${url}?page=${options.page}`
let fullUrl = `${url}?page=${options.page}`
if ( options.status ) {
fullUrl = `${fullUrl}&status=${options.status.toUpperCase()}`
}
configureClient(this.client, fullUrl)
const response = await this.client.get(fullUrl, 'List messages for webhook')
return response.data
Expand Down

0 comments on commit df2cfa3

Please sign in to comment.