update db name
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// GET /quotes
|
// GET /quotes
|
||||||
func getQuotes(w http.ResponseWriter, r *http.Request) {
|
func getQuotes(w http.ResponseWriter, r *http.Request) {
|
||||||
rows, err := db.Query(context.Background(), "SELECT * FROM quotes")
|
rows, err := db.Query(context.Background(), "SELECT * FROM hlaskovnik")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
@@ -41,7 +41,7 @@ func createQuote(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
err = db.QueryRow(
|
err = db.QueryRow(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
"INSERT INTO quotes(author, body) VALUES($1, $2) RETURNING id",
|
"INSERT INTO hlaskovnik(author, body) VALUES($1, $2) RETURNING id",
|
||||||
q.Author, q.Body,
|
q.Author, q.Body,
|
||||||
).Scan(&q.Id)
|
).Scan(&q.Id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user