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

Implemented: code to add functionality to subscribe or unsubscribe a webhook(#2ftb11u) #191

Merged
merged 30 commits into from
Jun 17, 2022

Conversation

ymaheshwari1
Copy link
Contributor

@ymaheshwari1 ymaheshwari1 commented Jun 17, 2022

Related Issues

Dependent on #178

Closes #175

Short Description and Why It's Useful

Screenshots of Visual Changes before/after (If There Are Any)

IMPORTANT NOTICE - Remember to add changelog entry

Contribution and Currently Important Rules Acceptance

Ravindra Purohit and others added 24 commits May 26, 2022 12:54
…ding action mapping and then using the same when calling the action(#2ftb11u)
…efined a mapping having id and correspoding service(#2ftb11u)
…instead of data property or methods(#2ftb11u)
…e to unsubscribeWebhook and added error handling in the unsubscribe action logic(#2ftb11u)
@@ -0,0 +1,7 @@
export default interface WebhookState {
cached: any
key: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir, removed unwanted state

}),
fileStatusUpdateWebhook(): boolean {
const webhookTopic = this.webhookEnums['BULK_OPERATIONS_FINISH']
return this.getCachedWebhook[webhookTopic]?.topic === webhookTopic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have topic as key, I think we could skip the comparison

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done Sir

if (resp.status == 200 && resp.data.webhooks?.length > 0 && !hasError(resp)) {
const webhooks = resp.data.webhooks;
const topics: any = {}
webhooks.map((topic: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
webhooks.map((topic: any) => {
webhooks.map((webhook: any) => {

@adityasharma7 adityasharma7 merged commit a4d0943 into hotwax:main Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement webhook configuration
3 participants