feat: add comments badge to task card
This commit is contained in:
@ -74,6 +74,7 @@ type Querier interface {
|
||||
GetAssignedTasksDueDateForUserID(ctx context.Context, arg GetAssignedTasksDueDateForUserIDParams) ([]Task, error)
|
||||
GetAssignedTasksProjectForUserID(ctx context.Context, arg GetAssignedTasksProjectForUserIDParams) ([]Task, error)
|
||||
GetAuthTokenByID(ctx context.Context, tokenID uuid.UUID) (AuthToken, error)
|
||||
GetCommentCountForTask(ctx context.Context, taskID uuid.UUID) (int64, error)
|
||||
GetCommentsForTaskID(ctx context.Context, taskID uuid.UUID) ([]TaskComment, error)
|
||||
GetConfirmTokenByEmail(ctx context.Context, email string) (UserAccountConfirmToken, error)
|
||||
GetConfirmTokenByID(ctx context.Context, confirmTokenID uuid.UUID) (UserAccountConfirmToken, error)
|
||||
|
@ -95,3 +95,6 @@ SELECT task.* FROM task_assigned
|
||||
)
|
||||
)
|
||||
ORDER BY task.due_date DESC, task_group.project_id DESC;
|
||||
|
||||
-- name: GetCommentCountForTask :one
|
||||
SELECT COUNT(*) FROM task_comment WHERE task_id = $1;
|
||||
|
@ -316,6 +316,17 @@ func (q *Queries) GetAssignedTasksProjectForUserID(ctx context.Context, arg GetA
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const getCommentCountForTask = `-- name: GetCommentCountForTask :one
|
||||
SELECT COUNT(*) FROM task_comment WHERE task_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetCommentCountForTask(ctx context.Context, taskID uuid.UUID) (int64, error) {
|
||||
row := q.db.QueryRowContext(ctx, getCommentCountForTask, taskID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const getCommentsForTaskID = `-- name: GetCommentsForTaskID :many
|
||||
SELECT task_comment_id, task_id, created_at, updated_at, created_by, pinned, message FROM task_comment WHERE task_id = $1 ORDER BY created_at
|
||||
`
|
||||
|
Reference in New Issue
Block a user