mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: create workspaces and templates for multiple orgs (#13866)
* chore: creating workspaces and templates to work with orgs * handle wrong org selected * create org member in coderdtest helper
This commit is contained in:
@@ -365,6 +365,7 @@ func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uui
|
||||
|
||||
type TemplateFilter struct {
|
||||
OrganizationID uuid.UUID
|
||||
ExactName string
|
||||
}
|
||||
|
||||
// asRequestOption returns a function that can be used in (*Client).Request.
|
||||
@@ -378,6 +379,10 @@ func (f TemplateFilter) asRequestOption() RequestOption {
|
||||
params = append(params, fmt.Sprintf("organization:%q", f.OrganizationID.String()))
|
||||
}
|
||||
|
||||
if f.ExactName != "" {
|
||||
params = append(params, fmt.Sprintf("exact_name:%q", f.ExactName))
|
||||
}
|
||||
|
||||
q := r.URL.Query()
|
||||
q.Set("q", strings.Join(params, " "))
|
||||
r.URL.RawQuery = q.Encode()
|
||||
|
||||
Reference in New Issue
Block a user