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

Adding post_id and type_ filters to combined reports. #5348

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

dessalines
Copy link
Member

- Added tests for these also.
- Some additional cleanup of the joins in reports_combined.
- Fixes #5265
PrivateMessages,
Communities,
}

Copy link
Member

Choose a reason for hiding this comment

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

Move this into crates/db_views/src/report_combined_view.rs as thats where its used.

Copy link
Member Author

@dessalines dessalines Jan 24, 2025

Choose a reason for hiding this comment

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

All these search and sort enums, that are used in api common, schema, views are here. I'd rather keep them in one place, rather than spread them out into different crates and files.

.eq(community::id)
.or(post::community_id.eq(community::id)),
);

Copy link
Member

Choose a reason for hiding this comment

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

You can move these into a helper function and reuse them for get_report_count() too.

Copy link
Member Author

@dessalines dessalines Jan 24, 2025

Choose a reason for hiding this comment

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

I'd like to do this for every DB view, but diesel's return types make it near impossible to externalize joins or filters into functions.

@Nutomic Nutomic merged commit 012e8c3 into main Jan 27, 2025
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.

[API] post_id field in ListCommentReportsRequest
3 participants