Skip to content

Commit c784d70

Browse files
committed
chore: updates for PR review
1 parent bd2bb03 commit c784d70

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

codersdk/organizations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uui
366366
type TemplateFilter struct {
367367
OrganizationID uuid.UUID `json:"organization_id,omitempty" format:"uuid" typescript:"-"`
368368
FilterQuery string `json:"q,omitempty"`
369-
ExactName string
369+
ExactName string `json:"exact_name,omitempty"`
370370
}
371371

372372
// asRequestOption returns a function that can be used in (*Client).Request.

site/src/api/queries/templates.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export const templatesByOrganizationId = (
4747
};
4848
};
4949

50-
export const templates = (filter: TemplateFilter = {
51-
ExactName: ""
52-
}) => {
50+
export const templates = (filter?: TemplateFilter) => {
5351
return {
5452
queryKey: ["templates", filter],
5553
queryFn: () => API.getTemplates(filter),

site/src/api/typesGenerated.ts

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

site/src/utils/templateAggregators.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ export const getTemplatesByTag = (
1010
all: templates,
1111
};
1212

13-
templates.forEach((template) => {
14-
template.tags.forEach((tag) => {
13+
for (const template of templates) {
14+
for (const tag of template.tags) {
1515
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- this can be undefined
1616
if (tags[tag]) {
1717
tags[tag].push(template);
1818
} else {
1919
tags[tag] = [template];
2020
}
21-
});
22-
});
21+
};
22+
};
2323

2424
return tags;
2525
};
@@ -29,14 +29,14 @@ export const getTemplatesByOrg = (templates: Template[]): TemplatesByOrg => {
2929
all: templates,
3030
};
3131

32-
templates.forEach((template) => {
32+
for (const template of templates) {
3333
const org = template.organization_name;
3434
if (orgs[org]) {
3535
orgs[org].push(template);
3636
} else {
3737
orgs[org] = [template];
3838
}
39-
});
39+
};
4040

4141
return orgs;
4242
};

0 commit comments

Comments
 (0)