Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding filtering and sorting options to listing user profiles endpoint #801

Open
1 of 2 tasks
mario-nt opened this issue Jan 26, 2025 · 1 comment · May be fixed by #805
Open
1 of 2 tasks

Adding filtering and sorting options to listing user profiles endpoint #801

mario-nt opened this issue Jan 26, 2025 · 1 comment · May be fixed by #805
Assignees
Labels
Easy Good for Newcomers Enhancement / Feature Request Something New good first issue Good for newcomers

Comments

@mario-nt
Copy link
Contributor

mario-nt commented Jan 26, 2025

The API endpoint for getting the list of user profiles can be improved by accepting the filter and sort query params to allow users to filter and sort user profiles.

Example: http://localhost:3001/users?search=john+doe&pageSize=50&page=1&filter=email+verfied&sorting=UploadedAsc

Part of torrust/torrust-index-gui#698

Estimate time of completion: 6-8 hours
Actual time of completion:

Tasks

  • Research and define filtering and sorting options
  • Changes to the listing users endpoint
@mario-nt
Copy link
Contributor Author

mario-nt commented Feb 5, 2025

Ideas for filtering users:

  • Email verified
  • Email not verified
  • Admin user
  • Non admin user
  • Bio?
  • Avatar?
  • Has uploaded torrents?
  • Date registered (Past year)
  • Date registered (This month)

Ideas for sorting users:

  • Date registered (Newest first)
  • Date registered (Oldest first)
  • Username (A → Z or Z → A)
  • Number of torrents uploaded (Asc or Desc)

This list can be improved in the future if we add additional info for the users such as new roles (moderator), comments...

Also, a really nice sorting idea would be based on seeding/leeching ratio.

But as a first iteration, I would implement the following which I think are the most useful for admin users:

Filtering

  1. Email verified
  2. Email not verified
  3. Has uploaded torrents

Sorting

  1. Date registered (Newest first)
  2. Date registered (Oldest first)
  3. Username (A → Z or Z → A)
  4. Number of torrents uploaded (Asc or Desc)

@josecelano @da2ce7

mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 7, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 13, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 17, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 17, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 18, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 21, 2025
mario-nt added a commit to mario-nt/torrust-index that referenced this issue Feb 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Easy Good for Newcomers Enhancement / Feature Request Something New good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant