Skip to content

feat: add filter by status on GET /users #1206

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

Merged
merged 12 commits into from
Apr 29, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

Discussion: #662 (comment)

Reason: The FE needs to get only the active users for now, so I think the best way for doing that is to add a filter on the GET /users endpoint so the FE can do /users?status=active.

@BrunoQuaresma BrunoQuaresma requested a review from a team April 28, 2022 13:19
@BrunoQuaresma BrunoQuaresma self-assigned this Apr 28, 2022
@BrunoQuaresma
Copy link
Collaborator Author

@presleyp this is a bit different from what we discussed in the epic but I think it is better since allows us to easily filter users using other statuses. What do you think?

@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #1206 (4a7ffd6) into main (1661588) will increase coverage by 0.21%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1206      +/-   ##
==========================================
+ Coverage   65.48%   65.69%   +0.21%     
==========================================
  Files         265      268       +3     
  Lines       16950    17020      +70     
  Branches      157      162       +5     
==========================================
+ Hits        11099    11182      +83     
+ Misses       4692     4678      -14     
- Partials     1159     1160       +1     
Flag Coverage Δ
unittest-go-macos-latest 53.00% <87.50%> (+0.12%) ⬆️
unittest-go-postgres- 64.65% <100.00%> (-0.05%) ⬇️
unittest-go-ubuntu-latest 55.34% <87.50%> (-0.11%) ⬇️
unittest-go-windows-2022 52.48% <87.50%> (-0.02%) ⬇️
unittest-js 68.85% <ø> (+2.35%) ⬆️
Impacted Files Coverage Δ
coderd/database/queries.sql.go 81.13% <100.00%> (+0.01%) ⬆️
coderd/users.go 61.00% <100.00%> (+0.13%) ⬆️
codersdk/users.go 64.40% <100.00%> (+0.20%) ⬆️
site/src/xServices/StateContext.tsx 92.30% <0.00%> (-7.70%) ⬇️
coderd/httpapi/httpapi.go 66.25% <0.00%> (-6.25%) ⬇️
site/src/xServices/users/usersXService.ts 81.25% <0.00%> (-4.47%) ⬇️
peerbroker/listen.go 87.39% <0.00%> (-3.37%) ⬇️
provisioner/echo/serve.go 56.80% <0.00%> (-2.41%) ⬇️
cli/cliui/provisionerjob.go 76.42% <0.00%> (-2.15%) ⬇️
site/src/pages/UsersPage/UsersPage.tsx 82.35% <0.00%> (-0.99%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1661588...4a7ffd6. Read the comment docs.

@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner April 28, 2022 13:22
@BrunoQuaresma BrunoQuaresma requested a review from Emyrk April 28, 2022 14:12
Copy link
Contributor

@presleyp presleyp left a comment

Choose a reason for hiding this comment

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

Yeah that approach works for me!

@BrunoQuaresma BrunoQuaresma requested a review from Emyrk April 28, 2022 18:57
@BrunoQuaresma BrunoQuaresma enabled auto-merge (squash) April 28, 2022 19:14
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

1 last comment

@BrunoQuaresma BrunoQuaresma requested a review from Emyrk April 28, 2022 20:49
@BrunoQuaresma BrunoQuaresma merged commit ba4c3ce into main Apr 29, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/return-only-active-users branch April 29, 2022 13:29
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
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.

4 participants