chore: don't require an organization to read starter templates (#14190)

This commit is contained in:
Kayla Washburn-Love
2024-08-06 11:26:26 -06:00
committed by GitHub
parent fab196043e
commit ff785588fe
14 changed files with 165 additions and 28 deletions
+10 -3
View File
@@ -472,9 +472,16 @@ type AgentStatsReportResponse struct {
TxBytes int64 `json:"tx_bytes"`
}
// TemplateExamples lists example templates embedded in coder.
func (c *Client) TemplateExamples(ctx context.Context, organizationID uuid.UUID) ([]TemplateExample, error) {
res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/templates/examples", organizationID), nil)
// TemplateExamples lists example templates available in Coder.
//
// Deprecated: Use StarterTemplates instead.
func (c *Client) TemplateExamples(ctx context.Context, _ uuid.UUID) ([]TemplateExample, error) {
return c.StarterTemplates(ctx)
}
// StarterTemplates lists example templates available in Coder.
func (c *Client) StarterTemplates(ctx context.Context) ([]TemplateExample, error) {
res, err := c.Request(ctx, http.MethodGet, "/api/v2/templates/examples", nil)
if err != nil {
return nil, err
}