Fix UUID cast in task creation, add kind test manifests
- Fix parent_task_id NULLIF cast to UUID type in INSERT query - Fix itoa helper to use strconv.Itoa - Handle AddReaction errors gracefully in webhook handler - Add hack/kind/ manifests for local testing with kind cluster
This commit is contained in:
@@ -2,6 +2,7 @@ package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
@@ -35,7 +36,7 @@ func (db *DB) CreateTask(ctx context.Context, req models.CreateTaskRequest) (*mo
|
||||
issue_number, pr_number, comment_id, body, author,
|
||||
extra_tools, pool_ref
|
||||
) VALUES (
|
||||
NULLIF($1, ''), $2, $3, $4, $5,
|
||||
NULLIF($1, '')::uuid, $2, $3, $4, $5,
|
||||
$6, $7, $8, $9, $10,
|
||||
$11, $12
|
||||
) RETURNING id, created_at`,
|
||||
@@ -173,5 +174,5 @@ func scanTasks(rows pgx.Rows) ([]models.Task, error) {
|
||||
}
|
||||
|
||||
func itoa(i int) string {
|
||||
return string(rune('0'+i)) + ""
|
||||
return strconv.Itoa(i)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user