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: auto flag proposal when the body contains flagged links #284

Merged
merged 9 commits into from
Jan 25, 2024

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Jan 23, 2024

🧿 Current issues / What's wrong ?

Proposals with flaggedLinks and proposals flagged manually are handled differently.

💊 Fixes / Solution

Auto-flag proposals containing flagged links, so the the only source of truth for flagging is the flagged column in the proposals table

🚧 Changes

  • Load flaggedLinks data from moderation endpoint
  • When creating and updating proposals, flag proposal when the body contains flagged links

🛠️ Tests

  • create some proposals with body containing flagged links
  • the proposal should be flagged, without manual moderation

@wa0x6e wa0x6e requested a review from ChaituVR January 23, 2024 12:18
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Files Patch % Lines
src/helpers/moderation.ts 89.28% 3 Missing ⚠️
src/writer/update-proposal.ts 33.33% 2 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

src/writer/proposal.ts Outdated Show resolved Hide resolved
src/helpers/moderation.ts Outdated Show resolved Hide resolved
@wa0x6e
Copy link
Contributor Author

wa0x6e commented Jan 24, 2024

Moderation.ts has been refactored a bit, to accommodate tests

@wa0x6e wa0x6e requested a review from ChaituVR January 24, 2024 16:58
src/writer/update-proposal.ts Outdated Show resolved Hide resolved
@wa0x6e wa0x6e requested a review from ChaituVR January 25, 2024 04:23
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.

tAck

@wa0x6e wa0x6e merged commit 2afaed6 into master Jan 25, 2024
4 checks passed
@wa0x6e wa0x6e deleted the auto-flag-proposals-with-flagged-links branch January 25, 2024 12:36
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.

2 participants