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

fix: skip webhooks for flagged proposals #147

Merged
merged 4 commits into from
Nov 28, 2023

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Nov 28, 2023

Fix #137

  • Skip webhooks for flagged proposals
  • Add tests

@wa0x6e wa0x6e requested a review from ChaituVR November 28, 2023 11:06
@@ -61,8 +61,7 @@ export async function getProposal(id) {
if (result.errors) {
console.error(`[events] Errors in subgraph request for proposal id: ${id}`);
}
proposal = result.proposal || null;
return proposal;
return result.proposal?.flagged ? null : result.proposal || null;
Copy link
Member

Choose a reason for hiding this comment

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

More confusing 🙈 how about

Suggested change
return result.proposal?.flagged ? null : result.proposal || null;
return result.proposal && !result.proposal.flagged ? result.proposal : null;

Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

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

utAck

@wa0x6e wa0x6e merged commit b649796 into master Nov 28, 2023
2 checks passed
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.

fix: stop sending webhook when proposal is flagged
2 participants