Skip to content

Commit e97c9db

Browse files
committed
feat: add request and response types
1 parent cea4d3c commit e97c9db

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

coderd/members.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ func (api *API) listMembers(rw http.ResponseWriter, r *http.Request) {
188188
// @Router /organizations/{organization}/paginated-members [get]
189189
func (api *API) paginatedMembers(rw http.ResponseWriter, r *http.Request) {
190190
ctx := r.Context()
191-
httpapi.Write(ctx, rw, http.StatusNotImplemented, nil)
191+
192+
resp := codersdk.PaginatedMembersResponse{}
193+
httpapi.Write(ctx, rw, http.StatusOK, resp)
192194
}
193195

194196
// @Summary Assign role to organization member

codersdk/organizations.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ type OrganizationMemberWithUserData struct {
8181
OrganizationMember `table:"m,recursive_inline"`
8282
}
8383

84+
type PaginatedMembersRequest struct {
85+
//
86+
OrganizationID uuid.UUID `table:"organization id" json:"organization_id" format:"uuid"`
87+
//
88+
Limit int `json:"limit,omitempty"`
89+
//
90+
Offset int `json:"offset,omitempty"`
91+
}
92+
93+
type PaginatedMembersResponse struct {
94+
//
95+
Members []OrganizationMemberWithUserData
96+
//
97+
Count int `json:"count"`
98+
}
99+
84100
type CreateOrganizationRequest struct {
85101
Name string `json:"name" validate:"required,organization_name"`
86102
// DisplayName will default to the same value as `Name` if not provided.

0 commit comments

Comments
 (0)