Conversation
Nutomic
commented
Aug 11, 2023
4e8c316 to
5d10e8e
Compare
dessalines
reviewed
Aug 22, 2023
| @@ -0,0 +1,51 @@ | |||
| -- Automatically resolve all reports for a given post once it is marked as removed | |||
| -- TODO: how to set `resolver_id`? | |||
Member
There was a problem hiding this comment.
Instead of using the post table as the triggering one, use an insert on the mod_remove_post table, and mod_remove_comment tables. A few benefits:
- It has the
mod_person_id, that you can use to set theresolver_id. - It has a
removedcolumn, meaning you could resolve or unresolve reports based on an insert to that table.
Member
Author
There was a problem hiding this comment.
Right that makes sense, changed it. Though Im not unresolving reports, it seems unnecessary.
| $$; | ||
|
|
||
| CREATE OR REPLACE TRIGGER post_removed_resolve_reports | ||
| AFTER UPDATE OF removed ON post |
Member
There was a problem hiding this comment.
This will change to Insert on the mod_remove_post table.
5d10e8e to
b9d2bdd
Compare
dessalines
approved these changes
Sep 4, 2023
Member
dessalines
left a comment
There was a problem hiding this comment.
Looks good. Just needs a clippy fix, then feel free to merge.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a database trigger to auto-resolve reports for removed posts/comments. This way no extra Rust code is necessary, and it also works in case of banning a user with "remove content" checkbox.