mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd): add lookup task by name in httpmw.TaskParam (#20647)
* Adds a `GetTaskByOwnerIDAndName` query * Updates `httpmw.TaskParam` to fall back to task name if no task by UUID found. * Updates the `TaskByIdentifier` used in `cli/` to use direct lookup instead of searching.
This commit is contained in:
@@ -41,6 +41,13 @@ SELECT * FROM tasks_with_status WHERE id = @id::uuid;
|
||||
-- name: GetTaskByWorkspaceID :one
|
||||
SELECT * FROM tasks_with_status WHERE workspace_id = @workspace_id::uuid;
|
||||
|
||||
-- name: GetTaskByOwnerIDAndName :one
|
||||
SELECT * FROM tasks_with_status
|
||||
WHERE
|
||||
owner_id = @owner_id::uuid
|
||||
AND deleted_at IS NULL
|
||||
AND LOWER(name) = LOWER(@name::text);
|
||||
|
||||
-- name: ListTasks :many
|
||||
SELECT * FROM tasks_with_status tws
|
||||
WHERE tws.deleted_at IS NULL
|
||||
|
||||
Reference in New Issue
Block a user