mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: alphabetize template list (#3363)
This commit is contained in:
@ -897,8 +897,8 @@ func (q *fakeQuerier) GetTemplatesWithFilter(_ context.Context, arg database.Get
|
||||
}
|
||||
if len(templates) > 0 {
|
||||
slices.SortFunc(templates, func(i, j database.Template) bool {
|
||||
if !i.CreatedAt.Before(j.CreatedAt) {
|
||||
return false
|
||||
if i.Name != j.Name {
|
||||
return i.Name < j.Name
|
||||
}
|
||||
return i.ID.String() < j.ID.String()
|
||||
})
|
||||
@ -1080,8 +1080,8 @@ func (q *fakeQuerier) GetTemplates(_ context.Context) ([]database.Template, erro
|
||||
|
||||
templates := slices.Clone(q.templates)
|
||||
slices.SortFunc(templates, func(i, j database.Template) bool {
|
||||
if !i.CreatedAt.Before(j.CreatedAt) {
|
||||
return false
|
||||
if i.Name != j.Name {
|
||||
return i.Name < j.Name
|
||||
}
|
||||
return i.ID.String() < j.ID.String()
|
||||
})
|
||||
|
Reference in New Issue
Block a user