createTicket working, solves #3
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user