Skip to content

Commit

Permalink
refactor(newrelic): use URLSearchParams
Browse files Browse the repository at this point in the history
  • Loading branch information
rofe committed Jul 1, 2020
1 parent 17a29f0 commit 380e25b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/newrelic/alerts.js
Expand Up @@ -254,8 +254,12 @@ async function updatePolicy(auth, policy, groupPolicy, monitorId, channelId, pol
method: 'PUT',
headers: {
'X-Api-Key': auth,
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `channel_ids=${encodeURIComponent(channelId)}&policy_id=${encodeURIComponent(policy.id)}`,
body: new URLSearchParams({
channel_ids: channelId,
policy_id: policy.id,
}).toString(),
});
const body = await resp.text();
if (!resp.ok) {
Expand Down

0 comments on commit 380e25b

Please sign in to comment.