-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat(NOJIRA-123): Add Webhook toggle funcion #74
Conversation
@@ -40,6 +40,18 @@ export class Webhooks { | |||
url: `/forms/${uid}/webhooks`, | |||
}) | |||
} | |||
|
|||
public toggle (args: { uid: string, tag: string, enabled: boolean }): Promise<Typeform.API.Webhooks.List> { | |||
const { uid, tag, enabled } = args |
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.
I tested this and it works nicely. However if the enabled
is not provided we assume false
value without any further info.
I am thinking about throwing an error when the value is not provided - the API call does not make much sense without it, right? However other API calls do not throw when params are missing either, even if they fail.
Maybe we could address this in as a separate feature / PR. WDYT @picsoung ?
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.
Thanks for your work man!
We should definitively take advantage to check the params shape, but across all endpoints, before it hits the API.
Just a simple function to toggle enable on a webhook
🎉 This PR is included in version 1.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I often need to change the state of a webhook.
The
update
function forces you to pass the URL pointing to the webhook.toggle
just turns on or off a webhook.