mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -278,12 +278,14 @@ func Templates(ctx context.Context, db database.Store, query string) (database.G
|
||||
parser := httpapi.NewQueryParamParser()
|
||||
filter := database.GetTemplatesWithFilterParams{
|
||||
Deleted: parser.Boolean(values, false, "deleted"),
|
||||
OrganizationID: parseOrganization(ctx, db, parser, values, "organization"),
|
||||
ExactName: parser.String(values, "", "exact_name"),
|
||||
FuzzyName: parser.String(values, "", "name"),
|
||||
IDs: parser.UUIDs(values, []uuid.UUID{}, "ids"),
|
||||
Deprecated: parser.NullableBoolean(values, sql.NullBool{}, "deprecated"),
|
||||
OrganizationID: parseOrganization(ctx, db, parser, values, "organization"),
|
||||
HasAITask: parser.NullableBoolean(values, sql.NullBool{}, "has-ai-task"),
|
||||
AuthorID: parser.UUID(values, uuid.Nil, "author_id"),
|
||||
AuthorUsername: parser.String(values, "", "author"),
|
||||
}
|
||||
|
||||
parser.ErrorExcessParams(values)
|
||||
|
||||
Reference in New Issue
Block a user