-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: Added /webhook/subscribed/:event api #994
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/livepeer/livepeer-com/8DifNqauWx8nW8SuF2E8gzk3zPL6 |
…peer-com into gio/api/subscribed_webhooks
let userId = req.user.id; | ||
|
||
if (req.user.admin && req.query.userId) { | ||
userId = req.query.userId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can use a ternary operator:
let userId = (req.user.admin && req.query.userId) ? req.query.userId : req.user.id;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even perhaps
let userId = (req.user.admin && req.query.userId) || req.user.id;
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
What does this pull request do? Explain your changes. (required)
Added /webhook/subscribed/:event api to retrieve all the webhooks subscribed to a particular event.
Admins can also provide a user id in the query to retrieve webhooks subscribed to an event of a particular user.
Needed by mapic to retrieve user.new subscriptions
Specific updates (required)
How did you test each of these updates (required)
Does this pull request close any open issues?
Screenshots (optional):
Checklist: