createTicket working, solves #3

This commit is contained in:
odweta
2026-08-16 17:41:56 +02:00
parent 94d743edfc
commit 8ae9cccc69
13 changed files with 127 additions and 34 deletions
+2 -2
View File
@@ -171,9 +171,9 @@ func createTicket(w http.ResponseWriter, r *http.Request) {
err = db.QueryRow(
context.Background(),
"INSERT INTO tickets(title, description) VALUES($1, $2) RETURNING id;",
"INSERT INTO tickets(title, description) VALUES($1, $2) RETURNING id, status, created_at, updated_at;",
t.Title, t.Description,
).Scan(&t.Id)
).Scan(&t.Id, &t.Status, &t.CreatedAt, &t.UpdatedAt)
if err != nil {
http.Error(w, err.Error(), 500)