-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for multiple zap urls (#3825)
* feat: support for multiple zap urls * fix: update endpoint to array * fix: use forEach instead of map, remove unused dependency --------- Co-authored-by: Sai Sankeerth <sanpj2292@github.com>
- Loading branch information
Showing
3 changed files
with
288 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { defaultRequestConfig } = require('../../../../v0/util'); | ||
|
||
const buildResponseList = (payload, endpointList) => { | ||
const responseList = []; | ||
endpointList.forEach((endpoint) => { | ||
const response = defaultRequestConfig(); | ||
response.body.JSON = payload; | ||
response.endpoint = endpoint; | ||
response.headers = { 'content-type': 'application/json' }; | ||
responseList.push(response); | ||
}); | ||
return responseList; | ||
}; | ||
|
||
module.exports = { buildResponseList }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters