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/like/list and /comment/like/list for admins. #4332

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

dessalines
Copy link
Member

- Allows admins to view likes, sorted by downvotes first,
  for a given comment or post.
- Fixes #4088
limit: Option<i64>,
) -> Result<Vec<Self>, Error> {
let conn = &mut get_conn(pool).await?;
let (limit, offset) = limit_and_offset(page, limit)?;
Copy link
Member

@Nutomic Nutomic Jan 2, 2024

Choose a reason for hiding this comment

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

This uses a default limit of 10 and maximum 50. As the vote objects are quite small and there can be lots of votes it would make sense to use higher values here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hrm... I'd rather not have a custom default just for this one specifically. The front ends can send a custom one anyway.

local_user_view: LocalUserView,
) -> Result<Json<ListPostLikesResponse>, LemmyError> {
// Make sure user is an admin
is_admin(&local_user_view)?;
Copy link
Member

@Nutomic Nutomic Jan 2, 2024

Choose a reason for hiding this comment

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

We could also make this accessible for mods so admins dont have to inspect votes on their own. I dont think its a big deal considering that Kbin even publishes all votes.

Copy link
Member Author

@dessalines dessalines Jan 3, 2024

Choose a reason for hiding this comment

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

I'd be open to it, but we can bump that for a later time. Admins-only makes sense to me, both for privacy reasons, and since downvote trolls are an instance-wide problem, not community specific.

@dessalines dessalines merged commit 009a45d into main Jan 3, 2024
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.

Make votes more transparent
2 participants