Skip to content

Commit ed2b48f

Browse files
committed
templates api response includes organization display name and icon
1 parent ef49cd7 commit ed2b48f

File tree

7 files changed

+17
-21
lines changed

7 files changed

+17
-21
lines changed

coderd/database/dump.sql

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000223_template_display_name.up.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ SELECT
99
coalesce(visible_users.username, '') AS created_by_username,
1010
coalesce(organizations.name, '') AS organization_name,
1111
coalesce(organizations.display_name, '') AS organization_display_name,
12-
coalesce(organizations.description, '') AS organization_description,
1312
coalesce(organizations.icon, '') AS organization_icon
1413
FROM
1514
templates

coderd/database/modelqueries.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
118118
&i.CreatedByUsername,
119119
&i.OrganizationName,
120120
&i.OrganizationDisplayName,
121-
&i.OrganizationDescription,
122121
&i.OrganizationIcon,
123122
); err != nil {
124123
return nil, err

coderd/database/models.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/templates.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,8 @@ func (api *API) convertTemplate(
886886
UpdatedAt: template.UpdatedAt,
887887
OrganizationID: template.OrganizationID,
888888
OrganizationName: template.OrganizationName,
889+
OrganizationDisplayName: template.OrganizationDisplayName,
890+
OrganizationIcon: template.OrganizationIcon,
889891
Name: template.Name,
890892
DisplayName: template.DisplayName,
891893
Provisioner: codersdk.ProvisionerType(template.Provisioner),

codersdk/templates.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ import (
1515
// Template is the JSON representation of a Coder template. This type matches the
1616
// database object for now, but is abstracted for ease of change later on.
1717
type Template struct {
18-
ID uuid.UUID `json:"id" format:"uuid"`
19-
CreatedAt time.Time `json:"created_at" format:"date-time"`
20-
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
21-
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
22-
OrganizationName string `json:"organization_name" format:"url"`
23-
Name string `json:"name"`
24-
DisplayName string `json:"display_name"`
25-
Provisioner ProvisionerType `json:"provisioner" enums:"terraform"`
26-
ActiveVersionID uuid.UUID `json:"active_version_id" format:"uuid"`
18+
ID uuid.UUID `json:"id" format:"uuid"`
19+
CreatedAt time.Time `json:"created_at" format:"date-time"`
20+
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
21+
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
22+
OrganizationName string `json:"organization_name" format:"url"`
23+
OrganizationDisplayName string `json:"organization_display_name"`
24+
OrganizationIcon string `json:"organization_icon"`
25+
Name string `json:"name"`
26+
DisplayName string `json:"display_name"`
27+
Provisioner ProvisionerType `json:"provisioner" enums:"terraform"`
28+
ActiveVersionID uuid.UUID `json:"active_version_id" format:"uuid"`
2729
// ActiveUserCount is set to -1 when loading.
2830
ActiveUserCount int `json:"active_user_count"`
2931
BuildTimeStats TemplateBuildTimeStats `json:"build_time_stats"`

0 commit comments

Comments
 (0)