feat: implement organization context in the cli (#12259)

* feat: implement organization context in the cli

`coder org show current`
This commit is contained in:
Steven Masley
2024-02-26 10:03:49 -06:00
committed by GitHub
parent f44c89d200
commit d2998c6b7b
24 changed files with 290 additions and 52 deletions

View File

@ -573,7 +573,7 @@ func (c *Client) OrganizationsByUser(ctx context.Context, user string) ([]Organi
return orgs, json.NewDecoder(res.Body).Decode(&orgs)
}
func (c *Client) OrganizationByName(ctx context.Context, user string, name string) (Organization, error) {
func (c *Client) OrganizationByUserAndName(ctx context.Context, user string, name string) (Organization, error) {
res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/users/%s/organizations/%s", user, name), nil)
if err != nil {
return Organization{}, err