Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add count endpoint for users, enabling better pagination #4848

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 18 commits into from
Nov 8, 2022
Merged
Prev Previous commit
Next Next commit
copy user array into local variable
  • Loading branch information
f0ssel committed Nov 4, 2022
commit 5b442b443238c23c495b8acec110ca2587235c58
2 changes: 1 addition & 1 deletion coderd/database/databasefake/databasefake.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (q *fakeQuerier) GetFilteredUserCount(_ context.Context, params database.Ge
q.mutex.RLock()
defer q.mutex.RUnlock()

users := make([]database.User, len(q.users))
users := append([]database.User{}, q.users...)

if params.Deleted {
tmp := make([]database.User, 0, len(users))
Expand Down