feat: add author filter command to template filtering (#19202)

Can do `author:username` to filter templates created by a certain
author. Adding to help clean out some templates that I created on our
dev instance. This makes sorting a bit easier.
This commit is contained in:
Steven Masley
2025-08-06 10:41:01 -05:00
committed by GitHub
parent 408e19fd98
commit 5b80c47e8c
6 changed files with 81 additions and 1 deletions
+6
View File
@@ -541,6 +541,7 @@ type TemplateFilter struct {
OrganizationID uuid.UUID `typescript:"-"`
ExactName string `typescript:"-"`
FuzzyName string `typescript:"-"`
AuthorUsername string `typescript:"-"`
SearchQuery string `json:"q,omitempty"`
}
@@ -562,6 +563,11 @@ func (f TemplateFilter) asRequestOption() RequestOption {
if f.FuzzyName != "" {
params = append(params, fmt.Sprintf("name:%q", f.FuzzyName))
}
if f.AuthorUsername != "" {
params = append(params, fmt.Sprintf("author:%q", f.AuthorUsername))
}
if f.SearchQuery != "" {
params = append(params, f.SearchQuery)
}