8000 feat: add a paginated organization members endpoint by brettkolodny · Pull Request #16835 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add a paginated organization members endpoint #16835

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 19 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add request and response types
  • Loading branch information
brettkolodny committed Mar 6, 2025
commit e97c9dbd88754f8c38e00f2c023c5f5c9b8c55da
4 changes: 3 additions & 1 deletion coderd/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ func (api *API) listMembers(rw http.ResponseWriter, r *http.Request) {
// @Router /organizations/{organization}/paginated-members [get]
func (api *API) paginatedMembers(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
httpapi.Write(ctx, rw, http.StatusNotImplemented, nil)

resp := codersdk.PaginatedMembersResponse{}
httpapi.Write(ctx, rw, http.StatusOK, resp)
}

// @Summary Assign role to organization member
Expand Down
16 changes: 16 additions & 0 deletions codersdk/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ type OrganizationMemberWithUserData struct {
OrganizationMember `table:"m,recursive_inline"`
}

type PaginatedMembersRequest struct {
//
OrganizationID uuid.UUID `table:"organization id" json:"organization_id" format:"uuid"`
//
Limit int `json:"limit,omitempty"`
//
Offset int `json:"offset,omitempty"`
}

type PaginatedMembersResponse struct {
//
Members []OrganizationMemberWithUserData
//
Count int `json:"count"`
}

type CreateOrganizationRequest struct {
Name string `json:"name" validate:"required,organization_name"`
// DisplayName will default to the same value as `Name` if not provided.
Expand Down
0