Skip to content
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

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Conversation

picsoung
Copy link
Contributor

@picsoung picsoung commented Jun 2, 2021

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.

@picsoung picsoung added the enhancement New feature or request label Jun 2, 2021
@picsoung picsoung requested a review from a team June 2, 2021 02:29
@vrybas vrybas requested a review from a team June 27, 2023 05:33
@@ -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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@mathio mathio changed the title Feat: Add Webhook toggle funcion feat(NOJIRA-123): Add Webhook toggle funcion Oct 4, 2023
@mathio mathio merged commit 5bf4e0f into main Oct 5, 2023
@typeform-ops-gha
Copy link

🎉 This PR is included in version 1.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mathio mathio deleted the webhook_toggle branch October 10, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants