mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): display tasks link when no templates contain an AI task (#19184)
Fixes https://github.com/coder/coder/issues/19059 This change ensures we always show the "Tasks" link, even when a deployment doesn't yet have a tasks template set up.
This commit is contained in:
@@ -13014,18 +13014,6 @@ func (q *sqlQuerier) GetTemplateVersionsCreatedAfter(ctx context.Context, create
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const hasTemplateVersionsWithAITask = `-- name: HasTemplateVersionsWithAITask :one
|
||||
SELECT EXISTS (SELECT 1 FROM template_versions WHERE has_ai_task = TRUE)
|
||||
`
|
||||
|
||||
// Determines if the template versions table has any rows with has_ai_task = TRUE.
|
||||
func (q *sqlQuerier) HasTemplateVersionsWithAITask(ctx context.Context) (bool, error) {
|
||||
row := q.db.QueryRowContext(ctx, hasTemplateVersionsWithAITask)
|
||||
var exists bool
|
||||
err := row.Scan(&exists)
|
||||
return exists, err
|
||||
}
|
||||
|
||||
const insertTemplateVersion = `-- name: InsertTemplateVersion :exec
|
||||
INSERT INTO
|
||||
template_versions (
|
||||
|
||||
Reference in New Issue
Block a user