chore: implement fuzzy name matching for templates (#14211)

* chore: add fuzzy name search for templates
* chore: implement fuzzy name matching for templates

Templates search query defaults to a fuzzy name match
This commit is contained in:
Steven Masley
2024-08-09 10:21:26 -05:00
committed by GitHub
parent 27b8f201a4
commit 591385f2ca
9 changed files with 71 additions and 10 deletions
+5
View File
@@ -9647,6 +9647,11 @@ func (q *FakeQuerier) GetAuthorizedTemplates(ctx context.Context, arg database.G
if arg.Deprecated.Valid && arg.Deprecated.Bool == (template.Deprecated != "") {
continue
}
if arg.FuzzyName != "" {
if !strings.Contains(strings.ToLower(template.Name), strings.ToLower(arg.FuzzyName)) {
continue
}
}
if len(arg.IDs) > 0 {
match := false