Skip to content

Commit

Permalink
fix: should check team + service + name instead (adding webhook) (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrn14897 authored Jan 10, 2025
1 parent e6d8501 commit 9daccff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tricky-actors-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/api": patch
---

fix: should check team + service + name uniq constraint instead (adding webhook)
2 changes: 1 addition & 1 deletion packages/api/src/routers/api/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ router.post(
}
const { name, service, url, description, queryParams, headers, body } =
req.body;
if (await Webhook.findOne({ team: teamId, service, url })) {
if (await Webhook.findOne({ team: teamId, service, name })) {
return res.status(400).json({
message: 'Webhook already exists',
});
Expand Down

0 comments on commit 9daccff

Please sign in to comment.