mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: resolve template name from working directory "." (#6822)
This commit is contained in:
@@ -221,6 +221,9 @@ func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uui
|
||||
|
||||
// TemplateByName finds a template inside the organization provided with a case-insensitive name.
|
||||
func (c *Client) TemplateByName(ctx context.Context, organizationID uuid.UUID, name string) (Template, error) {
|
||||
if name == "" {
|
||||
return Template{}, xerrors.Errorf("template name cannot be empty")
|
||||
}
|
||||
res, err := c.Request(ctx, http.MethodGet,
|
||||
fmt.Sprintf("/api/v2/organizations/%s/templates/%s", organizationID.String(), name),
|
||||
nil,
|
||||
|
||||
Reference in New Issue
Block a user