Skip to content

Commit eae0d20

Browse files
committed
chore: update TemplateFilter type to include FilterQuery
1 parent bc18c5d commit eae0d20

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

codersdk/organizations.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uui
364364
}
365365

366366
type TemplateFilter struct {
367-
OrganizationID uuid.UUID
367+
OrganizationID uuid.UUID `json:"organization_id,omitempty" typescript:"-"`
368+
FilterQuery string `json:"q,omitempty"`
368369
}
369370

370371
// asRequestOption returns a function that can be used in (*Client).Request.
@@ -378,6 +379,11 @@ func (f TemplateFilter) asRequestOption() RequestOption {
378379
params = append(params, fmt.Sprintf("organization:%q", f.OrganizationID.String()))
379380
}
380381

382+
if f.FilterQuery != "" {
383+
// If custom stuff is added, just add it on here.
384+
params = append(params, f.FilterQuery)
385+
}
386+
381387
q := r.URL.Query()
382388
q.Set("q", strings.Join(params, " "))
383389
r.URL.RawQuery = q.Encode()

0 commit comments

Comments
 (0)