Skip to content

Commit 9daccff

Browse files
authored
fix: should check team + service + name instead (adding webhook) (#550)
1 parent e6d8501 commit 9daccff

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/tricky-actors-judge.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/api": patch
3+
---
4+
5+
fix: should check team + service + name uniq constraint instead (adding webhook)

packages/api/src/routers/api/webhooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ router.post(
5858
}
5959
const { name, service, url, description, queryParams, headers, body } =
6060
req.body;
61-
if (await Webhook.findOne({ team: teamId, service, url })) {
61+
if (await Webhook.findOne({ team: teamId, service, name })) {
6262
return res.status(400).json({
6363
message: 'Webhook already exists',
6464
});

0 commit comments

Comments
 (0)