Skip to content

Commit a9bcf5f

Browse files
authored
fix(3706): test query for notebooks alert http endpoint (#3799)
1 parent 7b24b87 commit a9bcf5f

File tree

1 file changed

+9
-6
lines changed
  • src/flows/pipes/Notification/endpoints/HTTP

1 file changed

+9
-6
lines changed

src/flows/pipes/Notification/endpoints/HTTP/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ export default register => {
4545
messageFn: messageFn,
4646
crit: trigger,
4747
)
48-
|> monitor["notify"](data: notification, endpoint: http["endpoint"](url: "${data.url}")(mapFn: (r) => {
49-
body = {r with _version: 1}
50-
return {headers: {${_headers}}, data: json["encode"](v: body)}
48+
|> monitor["notify"](data: notification, endpoint: http.endpoint(url: "${data.url}")(
49+
mapFn: (r) => {
50+
body = {r with _version: 1}
51+
return {headers: {${_headers}}, data: json.encode(v: body)}
5152
}))`
5253
return out
5354
},
@@ -72,9 +73,11 @@ export default register => {
7273
}, [])
7374
.join(', ')
7475

75-
return `http["endpoint"](url: "${data.url}")(mapFn: (r) => {
76-
return {headers: {${_headers}}, data: json["encode"](v: "${TEST_NOTIFICATION}")}
77-
})
76+
return `http.post(
77+
url: "${data.url}",
78+
headers: {${_headers}},
79+
data: json.encode(v: { msg: "${TEST_NOTIFICATION}"})
80+
)
7881
7982
array.from(rows: [{value: 0}])
8083
|> yield(name: "ignore")`

0 commit comments

Comments
 (0)