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

comments: Allow retrieving all comment votes. #1591

Closed
5 tasks
lukebp opened this issue Nov 30, 2021 · 0 comments · Fixed by #1598
Closed
5 tasks

comments: Allow retrieving all comment votes. #1591

lukebp opened this issue Nov 30, 2021 · 0 comments · Fixed by #1598
Assignees
Labels
enhancement The issue enhances an existing feature.

Comments

@lukebp
Copy link
Member

lukebp commented Nov 30, 2021

The comment votes endpoint currently only allows you to retrieve comment votes for a specific user ID. This initial implementation was restrictive because that was all that politeiagui needs. Opening up the endpoint to allow a client to retrieve all comment votes made on a proposal, without needing to provide a user ID, has been requested in order to help analyze the proposal process. Comment votes are already public, so there is no reason to not allow this.

// Votes returns the comment votes that meet the provided filtering criteria.
type Votes struct {
	Token  string `json:"token"`
	UserID string `json:"userid"`
}

Implemenation

  • The user ID field needs to be made an optional filtering criteria.
  • The returned votes need to be paginated. A page number field neeeds to be added to the request payload. This should default to page 1 if not provided.
  • The page size should be added to the policy reply.
  • The comments plugin command needs to be updated to reflect the new implemenation. The page number and the filtering criteria (optional user ID) need to be applied.
  • Update pictl.

This should be done in a backwards comptable manner. Breaking changes to public API are not allowed.

@lukebp lukebp added enhancement The issue enhances an existing feature. 91cfcc8 labels Nov 30, 2021
@amass01 amass01 self-assigned this Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue enhances an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants