feat: implement task group actions

- allow sorting specifc task groups
- duplicate task group
- delete all tasks in task group
This commit is contained in:
Jordan Knott
2020-09-10 18:15:06 -05:00
parent 25f5cad557
commit 4272fefa28
19 changed files with 1727 additions and 192 deletions

View File

@ -2,6 +2,10 @@
INSERT INTO task (task_group_id, created_at, name, position)
VALUES($1, $2, $3, $4) RETURNING *;
-- name: CreateTaskAll :one
INSERT INTO task (task_group_id, created_at, name, position, description, complete, due_date)
VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING *;
-- name: UpdateTaskDescription :one
UPDATE task SET description = $2 WHERE task_id = $1 RETURNING *;
@ -17,6 +21,9 @@ SELECT * FROM task;
-- name: UpdateTaskLocation :one
UPDATE task SET task_group_id = $2, position = $3 WHERE task_id = $1 RETURNING *;
-- name: UpdateTaskPosition :one
UPDATE task SET position = $2 WHERE task_id = $1 RETURNING *;
-- name: DeleteTaskByID :exec
DELETE FROM task WHERE task_id = $1;