0.2.4 EstVeJurnah gota get it to return its id tho nut other than that diz good

This commit is contained in:
Peder Vatn Austad
2024-05-26 21:03:20 +02:00
parent 662ca02a7f
commit 4f01023df7
5 changed files with 74 additions and 235 deletions

View File

@@ -10,11 +10,10 @@ func InsertServiceDelivery(db *sql.DB, responseTimestamp string, recordedAtTime
var id int
err := db.QueryRow("INSERT INTO public.ServiceDelivery (ResponseTimestamp, RecordedAtTime) VALUES ($1, $2) RETURNING ID", responseTimestamp, recordedAtTime).Scan(&id)
fmt.Println(err)
if err != nil {
fmt.Println(err)
return 0, err
}
fmt.Println("ID:", id)
fmt.Println("ServiceDelivery inserted successfully!")
fmt.Println("ServiceDelivery inserted successfully! (", id, ")")
return id, nil
}